:root {
  --register-blue: #0878e8;
  --register-magenta: #7b2bbf;
  --register-green: #16a34a;
  --register-green-dark: #15803d;
  --field-border: #000000;
  --field-label: #64748b;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  display: block;
  padding: 24px;
  background: linear-gradient(135deg, #eaf4ff, #f7f1ff);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.register-header-layout {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-brand img {
  width: clamp(52px, 4vw, 72px);
  height: clamp(52px, 4vw, 72px);
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.08));
}

.header-brand h1 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(2rem, 2.6vw, 3.3rem);
  line-height: 0.94;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.header-brand p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 0.95rem;
}

.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.register-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-home-link,
.register-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 16px;
  border: 1px solid rgba(24, 38, 56, 0.15);
  border-radius: 999px;
  color: #000;
  background: #ffd700;
  font-size: 0.72rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
}

.register-home-link:hover,
.register-home-link:focus-visible,
.auth-home-link:hover,
.auth-home-link:focus-visible {
  color: #000;
  background: #ffeb3b;
  filter: brightness(.95);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.25);
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(24, 38, 56, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 3px 10px rgba(24, 38, 56, 0.12);
  flex-shrink: 0;
}

.language-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.language-switch label {
  min-width: 32px;
  padding: 5px 7px;
  border-radius: 999px;
  color: #58697d;
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

.language-switch input:checked + label {
  color: #fff;
  background: linear-gradient(90deg, #0878e8, #7b2bbf);
}

.register-plan {
  padding: 10px 16px;
  border: 2px solid #d0e8ff;
  border-radius: 999px;
  color: var(--register-blue);
  background: linear-gradient(135deg, #eff8ff, #f0f4ff);
  font-weight: 700;
  white-space: nowrap;
  font-size: clamp(0.75rem, 1.2vw, 0.95rem);
}

.register-required-legend {
  margin: 10px 0 0;
  color: #475467;
  font-size: .82rem;
  font-weight: 600;
}

.register-required-star {
  color: #dc2626;
  font-weight: 900;
}

.register-shell {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 40px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(19, 35, 58, 0.12);
}

.register-section { margin-top: 32px; }
.register-section:first-of-type { margin-top: 0; }

#planSelectionSection {
  width: 100%;
}

#planCardsContainer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 18px;
  width: 100%;
  align-items: stretch;
  margin-top: 6px;
}

#planCardsContainer[hidden] {
  display: none;
}

.plan-payment-summary {
  width: min(520px, 100%);
  margin: 18px auto 0;
  padding: 16px 22px;
  border: 1px solid rgba(19, 35, 58, 0.16);
  border-radius: 10px;
  background: #fbfdff;
  color: #13233a;
  box-shadow: 0 8px 18px rgba(19, 35, 58, 0.07);
}

.plan-payment-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.plan-payment-row span { text-align: left; }
.plan-payment-row strong { white-space: nowrap; text-align: right; }
.plan-payment-row[hidden] { display: none; }

.plan-payment-divider {
  margin: 10px 0;
  border-top: 1px dashed rgba(19, 35, 58, 0.35);
}

.plan-payment-total {
  font-size: 1.08rem;
  font-weight: 800;
}

.register-payment-choice {
  width: min(520px, 100%);
  margin: 24px auto 24px;
  padding: 12px 16px;
  border: 1px solid rgba(19, 35, 58, 0.16);
  border-radius: 8px;
  background: #fff;
  color: #13233a;
  text-align: center;
}

.register-payment-choice legend { padding: 0 4px; font-size: .8rem; font-weight: 800; }
.register-payment-method-title[hidden] { display: none; }
.register-payment-choice label { margin-right: 18px; font-weight: 700; cursor: pointer; }
.register-payment-title { width: min(520px, 100%); margin: 18px auto 0; color: #13233a; font-size: 1rem; text-align: left; }
.register-payment-actions { display: contents; }
.register-payment-button { width: 100%; min-height: 56px; padding: 9px 14px; border: 2px solid #0878e8; border-radius: 12px; background: #fff; color: #0878e8; font-size: 1.05rem; font-weight: 800; cursor: pointer; }
.register-payment-button:hover, .register-payment-button:focus-visible { background: #0878e8; color: #fff; }
.register-payment-button[hidden], .register-payment-choice[hidden], .register-payment-actions[hidden], .register-payment-title[hidden] { display: none; }

@media (max-width: 520px) {
  .register-payment-button { width: 100%; }
}

@media (max-width: 520px) {
  .plan-payment-summary { padding: 14px 16px; }
  .plan-payment-row { gap: 10px; font-size: 0.88rem; }
  .plan-payment-total { font-size: 1rem; }
}

.plan-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 282px;
  min-width: 0;
  padding: 18px;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  background: #f3f8ff;
  color: #17314f;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.plan-card[data-slug="essential"].selected { border-color: #0878e8; }
.plan-card[data-slug="professional"].selected { border-color: #7b2bbf; }
.plan-card[data-slug="advanced"].selected { border-color: #f59e0b; }
.plan-card:not(.selected) { border-color: #cbd5e1; }

.plan-card:hover {
  transform: translateY(-1px);
  opacity: 0.98;
}

.plan-card.selected {
  background: #eef6ff;
  box-shadow: 0 12px 22px rgba(51, 102, 163, 0.11);
}

.plan-card.is-disabled {
  opacity: 0.68;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.22);
}

.plan-card-name,
.plan-card-price,
.plan-card-setup {
  width: 100%;
  white-space: nowrap;
  text-align: center;
}

.plan-card-name {
  margin: 0 0 10px;
  font-size: clamp(1.02rem, 1.6vw, 1.35rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #10233c;
  line-height: 1.2;
}

.plan-card-price {
  margin-bottom: 10px;
  font-size: clamp(1.15rem, 1.8vw, 1.8rem);
  font-weight: 800;
  line-height: 1.2;
  color: #10233c;
}

.plan-card-price .currency-sign {
  margin-right: 0.12em;
}

.plan-card-price small {
  font-size: 0.54em;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #10233c;
}

.plan-card-setup {
  margin: 0 0 10px;
  color: #10233c;
  font-size: 0.9rem;
  line-height: 1.45;
}

.plan-card-setup .setup-label {
  display: inline-block;
  margin-bottom: 2px;
  font-weight: 400;
}

.plan-card-setup .setup-value {
  font-weight: 700;
}

.plan-card-description {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 52px;
  color: #10233c;
  font-size: 1.02rem;
  line-height: 1.5;
  text-align: center;
  font-weight: 400;
  white-space: normal;
  overflow-wrap: anywhere;
}

.plan-card-description-top,
.plan-card-description-bottom {
  display: block;
}

.register-section h2 {
  width: 100%;
  margin: 0 0 20px;
  padding: 14px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--register-blue), #0563c1);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  box-shadow: 0 12px 24px rgba(8, 120, 232, 0.15);
}

.register-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.register-field { display: grid; gap: 8px; min-width: 0; }
.register-field-full { grid-column: 1 / -1; }
.register-grid > .register-field:last-child:nth-child(odd) { grid-column: 1 / -1; }
.register-business-hours { gap: 14px; }
.register-business-hours-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.register-business-whatsapp { padding-top: 24px; }
.register-business-address { gap: 12px; }
.register-business-address h3 { margin: 0; color: #13233a; font-size: .95rem; font-weight: 800; }
.register-address-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; align-items: start; }
.register-business-address:not(:has(.register-address-options)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.register-business-address:not(:has(.register-address-options)) > h3,
.register-business-address:not(:has(.register-address-options)) > .register-business-address-grid,
.register-business-address:not(:has(.register-address-options)) > .register-hint { grid-column: 1 / -1; }
.register-business-address:not(:has(.register-address-options)) > .register-address-copy { grid-column: 1; grid-row: 2; }
.register-business-address:not(:has(.register-address-options)) > .register-online-only { grid-column: 2; grid-row: 2; }
.register-business-address:not(:has(.register-address-options)) > .register-business-address-grid { grid-row: 3; }
.register-business-address-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.register-business-address-grid[hidden] { display: none; }
.register-address-label { display: block; color: var(--field-label); font-size: .85rem; font-weight: 700; }
.register-address-select { width: 100%; min-width: 0; min-height: 44px; padding: 9px 12px; border: 1px solid #b4bfd0; border-radius: 8px; color: #13233a; background: #fff; font: inherit; font-size: 1rem; }
.register-address-select:focus { outline: 3px solid rgba(8, 120, 232, .2); border-color: #0878e8; }
.register-address-copy,
.register-online-only { display: flex; align-items: flex-start; gap: 10px; min-width: 0; color: #334155; font-size: .9rem; font-weight: 600; line-height: 1.4; cursor: pointer; }
.register-address-copy input,
.register-online-only input { width: 20px; height: 20px; min-width: 20px; margin: 0; accent-color: #0878e8; }
.register-field-hours { min-width: 0; }
.register-hours-label { display: block; color: var(--field-label); font-size: .85rem; font-weight: 700; }
.register-hours-preset,
.register-hours-cell select,
.register-hours-cell input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #b4bfd0;
  border-radius: 8px;
  color: #13233a;
  background: #fff;
  font: inherit;
  font-size: 1rem;
}
.register-hours-preset:focus,
.register-hours-cell select:focus,
.register-hours-cell input:focus { outline: 3px solid rgba(8, 120, 232, .2); border-color: #0878e8; }
.register-hours-variable { width: 100%; box-sizing: border-box; min-width: 0; margin: 8px 0 0; padding: 12px 0 0; border: 0; border-top: 1px solid #dbe3ed; }
.register-hours-variable[hidden] { display: none; }
.register-hours-variable legend { padding: 0 8px 0 0; color: #13233a; font-size: .9rem; font-weight: 700; }
.register-hours-table-head,
.register-hours-row { display: grid; grid-template-columns: minmax(110px, 1.2fr) minmax(110px, 1fr) repeat(2, minmax(110px, 1fr)); gap: 10px; }
.register-hours-table-head { margin: 2px 0 6px; color: #475467; font-size: .78rem; font-weight: 700; }
.register-hours-row { align-items: end; padding: 8px 0; border-bottom: 1px solid #e6ebf1; }
.register-hours-cell { display: grid; gap: 5px; min-width: 0; }
.register-hours-cell-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.register-field-language-row { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 18px; }
.register-field-language-row > * { min-width: 0; width: 100%; }
.language-mode-switch-wrap {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.language-mode-label {
  display: block;
  width: 100%;
  color: var(--field-label);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
}
.language-mode-switch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}
.language-option {
  position: relative;
  z-index: 1;
  min-height: 52px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #334155;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.language-option.active {
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.14);
}
.language-option:hover { transform: translateY(-1px); }
.language-option:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.28);
  outline-offset: 2px;
}
@media (max-width: 640px) { .register-field-language-row { grid-template-columns: 1fr; } }

@media (min-width: 681px) and (max-width: 900px) {
  .register-shell { padding: 28px; }
  .header-brand h1 { font-size: clamp(1.85rem, 4vw, 2.6rem); }
}

.floating-wrapper {
  position: relative;
  width: 100%;
  min-height: 58px;
}

.floating-wrapper input,
.floating-wrapper select {
  width: 100%;
  min-height: 60px;
  padding: 20px 16px 10px;
  border: 1px solid var(--field-border);
  border-radius: 14px;
  color: #000;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  line-height: 1.3;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: none;
}

.floating-wrapper input::placeholder,
.floating-wrapper select::placeholder { color: transparent; }

.floating-wrapper input:hover,
.floating-wrapper select:hover { border-color: #333; }

.floating-wrapper input:focus,
.floating-wrapper select:focus {
  outline: none;
  border-color: #000;
  box-shadow: none;
}

.floating-wrapper label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 4px;
  background: transparent;
  color: var(--field-label);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  z-index: 1;
  transition: transform 0.18s ease, top 0.18s ease, left 0.18s ease, color 0.18s ease, font-size 0.18s ease, background-color 0.18s ease;
}

.floating-wrapper:has(input[required]) label::after,
.floating-wrapper:has(select[required]) label::after {
  content: ' *';
  color: #dc2626;
}

.floating-wrapper:focus-within label,
.floating-wrapper:has(input:not(:placeholder-shown)) label,
.floating-wrapper:has(select:valid) label {
  top: 1px;
  left: 14px !important;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: #000;
  background: #fff;
}

.select-floating:has(select option:checked[value=""]):not(:focus-within) > label {
  opacity: 0;
}

.floating-wrapper:has(input:invalid:not(:placeholder-shown)) label,
.floating-wrapper:has(select:invalid) label,
.floating-wrapper.has-error label {
  color: #dc2626 !important;
}

.floating-wrapper:has(input:invalid:not(:placeholder-shown)) input,
.floating-wrapper:has(select:invalid) select,
.floating-wrapper.has-error input,
.floating-wrapper.has-error select {
  border-color: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}

.select-floating select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 42px;
}

.password-field input { padding-right: 42px; }

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.04);
  color: #000;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: all 0.2s ease;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: rgba(0, 0, 0, 0.08);
  outline: none;
}

/* ==========================================================================
   TELÉFONO (intl-tel-input v24) - INTEGRACIÓN LIMPIA
   ========================================================================== */

.phone-floating {
  position: relative;
  width: 100%;
}

.phone-floating .iti {
  width: 100%;
  display: block;
}

/* 1. Altura y centrado vertical exacto del texto y prefijo */
.phone-floating input[type="tel"] {
  width: 100%;
  height: 60px !important;
  min-height: 60px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-right: 16px !important;
  line-height: normal !important;
  font-size: 1rem !important;
  color: #000;
  background: transparent;
  border: 1px solid var(--field-border);
  border-radius: 14px;
  box-sizing: border-box;
}

.phone-floating .iti__selected-country {
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
  padding-left: 12px !important;
  padding-right: 6px !important;
  background: transparent !important;
}

.phone-floating .iti__selected-dial-code {
  color: #0f172a !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  line-height: normal !important;
  margin-left: 4px;
}

/* 2. Menú desplegable de países: ancho correcto, buscador visible y por encima de todo */
.phone-floating .iti__dropdown-content {
  z-index: 9999 !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2) !important;
  min-width: 320px !important;
  max-width: calc(100vw - 32px) !important;
  margin-top: 6px !important;
}

/* 3. Etiqueta flotante (Teléfono / WhatsApp) */
.phone-floating label {
  position: absolute;
  top: 50% !important;
  left: 88px !important;
  transform: translateY(-50%) !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: var(--field-label) !important;
  background: transparent !important;
  pointer-events: none;
  z-index: 1 !important;
  transition: transform 0.18s ease, top 0.18s ease, left 0.18s ease, color 0.18s ease, font-size 0.18s ease;
}

/* Flota arriba al enfocar, al escribir o al abrir el selector */
.phone-floating:focus-within label,
.phone-floating:has(input:not(:placeholder-shown)) label,
.phone-floating:has(.iti--isOpen) label,
.phone-floating:has(.iti--show-dropdown) label {
  top: 1px !important;
  left: 14px !important;
  transform: translateY(-50%) !important;
  font-size: 0.8rem !important;
  color: #000 !important;
  background: #fff !important;
  padding: 0 4px !important;
  z-index: 2 !important;
}
.phone-floating .iti__country-list {
  border: 1px solid var(--field-border);
  border-radius: 12px;
  overflow: hidden;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  margin-top: 4px;
  background: #fff;
  z-index: 1000;
}

.phone-floating .iti__search-input {
  width: calc(100% - 12px);
  margin: 6px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
}

.phone-floating .iti__country { 
  padding: 10px 14px; 
  cursor: pointer;
}

.phone-floating .iti__country:hover { 
  background-color: #f1f5f9; 
}

.phone-floating .iti__country.iti__highlight { 
  background-color: #eff8ff; 
}

.register-hint {
  margin: 2px 2px 0;
  color: #64748b;
  font-size: .77rem;
  font-weight: 500;
}

.register-error,
.register-success {
  display: none;
  min-height: 0;
  margin-top: 18px;
  font-weight: 600;
  border-radius: 10px;
  padding: 10px 12px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.register-error.is-visible,
.register-success.is-visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.register-error { color: #991b1b; background: #fee2e2; border-left: 4px solid #dc2626; }
.register-success { color: #166534; background: #dcfce7; border-left: 4px solid #16a34a; }

.register-submit {
  width: 100%;
  min-height: 54px;
  margin-top: 24px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--register-green), var(--register-green-dark));
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 16px rgba(22, 163, 74, 0.25);
  letter-spacing: -0.3px;
}

.register-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(22, 163, 74, 0.35);
}

/* Contenedor de botones para nuevo bot */
.register-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
  width: 100%;
}

.register-buttons .register-submit,
.register-buttons .register-cancel {
  margin-top: 0;
  width: 100%;
  min-height: 56px;
  border-radius: 12px;
  font-size: 1.05rem;
  min-width: 0;
}

.register-buttons .register-submit {
  flex: 1;
  background: linear-gradient(135deg, var(--register-blue), #0563c1);
  box-shadow: 0 10px 20px rgba(8, 120, 232, 0.22);
  color: #fff;
}

.register-buttons .register-submit:hover {
  box-shadow: 0 12px 24px rgba(8, 120, 232, 0.32);
}

.register-cancel {
  flex: 1;
  min-height: 56px;
  border: 2px solid #ef4444;
  border-radius: 12px;
  color: #ef4444;
  background: transparent;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: -0.3px;
  width: 100%;
  box-shadow: none;
}

.register-cancel:hover {
  background: rgba(239, 68, 68, 0.04);
  transform: translateY(-2px);
}

.register-cancel:active {
  transform: translateY(0);
}

.register-back {
  display: block;
  margin: 12px 0 0;
  color: var(--register-blue);
  text-align: center;
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
}
.register-back.hidden { display: none !important; }
.register-home-link.hidden { display: none !important; }
.register-back:hover { color: #0563c1; text-decoration: underline; }

.register-branding {
  margin: 18px 0 0;
  color: #94a3b8;
  font-size: .76rem;
  text-align: center;
}
.register-branding strong { color: #0f172a; font-weight: 700; }

/* === RESPONSIVE PARA MÓVILES (PC Y TABLETS QUEDAN INTACTOS) === */
@media (max-width: 680px) {
  body { 
    padding: 12px; 
  }
  
  .register-shell { 
    padding: 24px 16px; 
  }
  
  .register-header-layout {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .header-brand {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .header-brand h1 { 
    font-size: clamp(1.8rem, 7vw, 2.4rem);
    line-height: 1;
  }

  .header-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  /* BARRA SUPERIOR EN TELÉFONOS: Inicio a la izquierda, Idioma a la derecha */
  .register-topbar {
    display: flex;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    gap: 8px;
  }

  /* Ancho automático según su contenido (no a lo ancho) */
  .register-home-link,
  .auth-home-link {
    width: auto !important;
    flex-shrink: 0;
  }

  .language-switch {
    width: auto !important;
    flex-shrink: 0;
  }

  .register-plan {
    width: 100%;
    text-align: center;
  }

  .register-grid { 
    grid-template-columns: 1fr; 
    gap: 14px; 
  }
  
  .register-field-full { 
    grid-column: auto; 
  }
  .register-grid > .register-field:last-child:nth-child(odd) { grid-column: auto; }
  .register-business-hours-row { grid-template-columns: 1fr; gap: 14px; }
  .register-business-whatsapp { padding-top: 0; }
  .register-business-address-grid { grid-template-columns: 1fr; gap: 12px; }

  .register-hours-table-head { display: none; }
  .register-hours-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .register-hours-cell-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; color: #475467; font-size: .75rem; font-weight: 700; white-space: normal; }
}

.register-hint {
  margin: 2px 2px 0;
  color: #64748b;
  font-size: .77rem;
  font-weight: 500;
}

.register-notice {
  display: none;
}

.register-error,
.register-success {
  display: none;
  min-height: 0;
  margin-top: 18px;
  font-weight: 600;
  border-radius: 10px;
  padding: 10px 12px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.register-error:not(:empty),
.register-success:not(:empty) {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.register-error {
  color: #991b1b;
  background: #fee2e2;
  border-left: 4px solid #dc2626;
}

.register-success {
  color: #166534;
  background: #dcfce7;
  border-left: 4px solid #16a34a;
}

.register-submit {
  width: 100%;
  min-height: 52px;
  margin-top: 24px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--register-green), var(--register-green-dark));
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 16px rgba(22, 163, 74, 0.25);
  letter-spacing: -0.3px;
}

.register-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(22, 163, 74, 0.35);
}

.register-submit:active {
  transform: translateY(0);
}

.register-submit:disabled {
  opacity: .65;
  cursor: wait;
  transform: none;
}

.register-back {
  display: block;
  margin: 12px 0 0;
  color: var(--register-blue);
  text-align: center;
  font-weight: 700;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  text-decoration: none;
}

.register-back:hover {
  color: #0563c1;
  text-decoration: underline;
}

.register-branding {
  margin: 18px 0 0;
  color: #94a3b8;
  font-size: .76rem;
  text-align: center;
}

.register-branding strong {
  color: #0f172a;
  font-weight: 700;
}

.register-buttons:has(#cancelBotButton[style*="display: none"]) {
  grid-template-columns: 1fr;
  justify-items: center;
}

.register-buttons:has(#cancelBotButton[style*="display: none"]) .register-submit {
  width: min(100%, 430px);
}

.register-back {
  margin-top: 30px;
}

/* ========================================================================== */
/* MODALES - Bot Name Taken & Phone Duplicate */
/* ========================================================================== */
.register-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.register-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.register-modal-content {
  position: relative;
  width: min(500px, 90vw);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
  z-index: 1;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.register-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid #e2e8f0;
}

.register-modal-header h2 {
  margin: 0;
  color: #0f172a;
  font-size: 1.25rem;
  font-weight: 700;
}

.register-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
}

.register-modal-close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #0f172a;
}

.register-modal-body {
  padding: 24px;
  color: #475467;
  font-size: 0.95rem;
  line-height: 1.6;
}

.register-modal-body p {
  margin: 0 0 12px;
}

.register-modal-body p:last-child {
  margin-bottom: 0;
}

.register-modal-footer {
  padding: 20px 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.register-modal-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, #0878e8, #0563c1);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(8, 120, 232, 0.2);
}

.register-modal-btn-primary:hover {
  background: linear-gradient(90deg, #0563c1, #044ba8);
  box-shadow: 0 6px 16px rgba(8, 120, 232, 0.3);
  transform: translateY(-2px);
}

.register-modal-btn-primary:active {
  transform: translateY(0);
}

@media (max-width: 560px) {
  body {
    padding: 12px;
  }

  .register-shell {
    padding: 24px 16px;
  }

  .register-topbar {
    justify-content: center;
  }

  .register-header {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 10px;
    margin: 0 0 22px;
  }

  .register-header img {
    width: 50px;
    height: 50px;
  }

  .register-header h1 {
    font-size: clamp(1.5rem, 7vw, 2.4rem);
    white-space: normal;
    line-height: 1;
  }

  .register-plan {
    justify-self: center;
    margin-top: 4px;
  }

  .register-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .register-field-full {
    grid-column: auto;
  }

  .register-submit {
    min-height: 48px;
    font-size: 0.95rem;
  }
}

body {
  color: #13233a;
  background: linear-gradient(135deg, #edf4ff, #f7f1ff);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.register-shell {
  border-radius: 16px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 14px 30px rgba(19, 35, 58, .18);
}

.register-section h2 {
  border-radius: 8px;
  background: linear-gradient(90deg, #0878e8, #7b2bbf);
  box-shadow: 0 8px 18px rgba(8, 120, 232, .14);
}

.floating-wrapper input,
.floating-wrapper select {
  min-height: 44px;
  border: 1px solid #b4bfd0;
  border-radius: 8px;
  color: #13233a;
  background: #fff;
}

.floating-wrapper input:focus,
.floating-wrapper select:focus {
  border-color: #0878e8;
  box-shadow: 0 0 0 3px rgba(18, 195, 216, .24);
}

.select-floating select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 42px;
}

form .floating-wrapper > input:not([type="hidden"]),
form .floating-wrapper > select,
form select.register-address-select,
form select.register-hours-preset,
form .register-hours-cell input,
form .register-hours-cell select {
  box-sizing: border-box;
  height: 54px;
  min-height: 54px;
}

.register-grid .phone-floating input[type="tel"] {
  height: 54px !important;
  min-height: 54px !important;
}

.register-buttons .register-submit,
.register-submit {
  border-radius: 8px;
  background: linear-gradient(135deg, var(--register-green), var(--register-green-dark));
  box-shadow: 0 8px 16px rgba(22, 163, 74, .25);
}
