/**
 * fc-nav-modal · modal.css
 *
 * Modal de login/registro del navbar global. Prefijo BEM `fcnm-`.
 *
 * Paleta brand Fullcarro:
 *   --fcnm-primary       #FF9540 (naranja)
 *   --fcnm-primary-dark  #E07F2E
 *   --fcnm-navy          #374B5C
 *   --fcnm-bg-soft       #FFF8E5 (crema)
 *   --fcnm-text          #1F2937
 *   --fcnm-muted         #6B7280
 *   --fcnm-border        #E5E7EB
 *   --fcnm-error         #DC2626
 *   --fcnm-success       #16A34A
 *
 * Layout:
 *   - Desktop: modal centrado, max-width 480px
 *   - Mobile (≤640px): bottom-sheet slide-up
 *
 * Diseño consistente con fc-login-modal pero más simple
 * (sin contexto de vendedor / icono dinámico).
 */

.fcnm-modal {
  --fcnm-primary:       #FF9540;
  --fcnm-primary-dark:  #E07F2E;
  --fcnm-navy:          #374B5C;
  --fcnm-bg-soft:       #FFF8E5;
  --fcnm-text:          #1F2937;
  --fcnm-muted:         #6B7280;
  --fcnm-muted-2:       #9CA3AF;
  --fcnm-border:        #E5E7EB;
  --fcnm-bg-card:       #FFFFFF;
  --fcnm-error:         #DC2626;
  --fcnm-success:       #16A34A;
  --fcnm-radius-md:     12px;
  --fcnm-radius-sm:     8px;
  --fcnm-shadow:        0 24px 64px rgba(55,75,92,0.18), 0 8px 24px rgba(55,75,92,0.10);
  --fcnm-ease:          cubic-bezier(0.16, 1, 0.3, 1);
}

/* ═══════════════════════════════════════════════════════════
 *  Modal container · default oculto
 * ═══════════════════════════════════════════════════════════ */
.fcnm-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  font-family: 'Inter', 'Comfortaa', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.fcnm-modal.is-open    { display: block; }
.fcnm-modal.is-visible .fcnm-modal__backdrop { opacity: 1; }
.fcnm-modal.is-visible .fcnm-modal__card     { transform: translateY(0); opacity: 1; }

/* Body lock cuando modal abierto */
body.fcnm-modal-open { overflow: hidden; }

/* ── Backdrop ─────────────────────────────────────────────── */
.fcnm-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 31, 61, 0.55);
  opacity: 0;
  transition: opacity .25s var(--fcnm-ease);
  backdrop-filter: blur(2px);
}

/* ── Card (mobile bottom-sheet por default) ───────────────── */
.fcnm-modal__card {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: 92vh;
  background: var(--fcnm-bg-card);
  border-radius: 18px 18px 0 0;
  padding: 22px 22px 14px;
  box-shadow: var(--fcnm-shadow);
  overflow-y: auto;
  transform: translateY(100%);
  opacity: 0;
  transition: transform .35s var(--fcnm-ease), opacity .25s var(--fcnm-ease);
  -webkit-overflow-scrolling: touch;
}

/* Desktop: modal centrado */
@media (min-width: 641px) {
  .fcnm-modal {
    display: none;
  }
  .fcnm-modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
  }
  .fcnm-modal__card {
    position: relative;
    left: auto; right: auto; bottom: auto;
    max-width: 480px;
    width: 100%;
    border-radius: 18px;
    padding: 28px 28px 20px;
    transform: translateY(20px) scale(0.97);
  }
  .fcnm-modal.is-visible .fcnm-modal__card { transform: translateY(0) scale(1); }
}

/* ── Close button ─────────────────────────────────────────── */
.fcnm-modal__close {
  position: absolute;
  top: 12px; right: 12px;
  width: 36px; height: 36px;
  border: 0;
  background: transparent;
  border-radius: 50%;
  color: var(--fcnm-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s;
  z-index: 2;
}
.fcnm-modal__close:hover { background: rgba(0,0,0,0.05); color: var(--fcnm-text); }

/* ═══════════════════════════════════════════════════════════
 *  Header común a todos los steps
 * ═══════════════════════════════════════════════════════════ */
.fcnm-modal__header {
  text-align: center;
  margin-bottom: 18px;
}
.fcnm-modal__icon-circle {
  width: 54px;
  height: 54px;
  background: var(--fcnm-bg-soft);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  color: var(--fcnm-primary);
}
.fcnm-modal__icon-circle--success {
  background: #F0FDF4;
  color: var(--fcnm-success);
}
.fcnm-modal__title {
  margin: 0 0 6px;
  font: 700 20px/1.3 'Comfortaa', Arial, sans-serif;
  color: var(--fcnm-text);
}
.fcnm-modal__subtitle {
  margin: 0;
  font: 400 13.5px/1.55 'Inter', Arial, sans-serif;
  color: var(--fcnm-muted);
}

/* Pill arriba del form register que indica tipo seleccionado */
.fcnm-modal__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--fcnm-bg-soft);
  color: var(--fcnm-primary-dark);
  font: 600 12px/1 'Inter', sans-serif;
  padding: 6px 12px;
  border-radius: 99px;
  margin-bottom: 10px;
}

/* Back button (cambiar tipo de cuenta) */
.fcnm-back {
  position: absolute;
  top: 14px;
  left: 14px;
  background: transparent;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 500 12px/1 'Inter', sans-serif;
  color: var(--fcnm-muted);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background .15s, color .15s;
}
.fcnm-back:hover {
  background: rgba(0,0,0,0.04);
  color: var(--fcnm-text);
}

/* ═══════════════════════════════════════════════════════════
 *  Mensaje feedback (errores/success)
 * ═══════════════════════════════════════════════════════════ */
.fcnm-modal__msg {
  display: none;
  padding: 11px 14px;
  border-radius: var(--fcnm-radius-sm);
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 14px;
}
.fcnm-modal__msg.is-show     { display: block; }
.fcnm-modal__msg.is-error    { background: #FEE2E2; color: #991B1B; border-left: 3px solid #DC2626; }
.fcnm-modal__msg.is-success  { background: #DCFCE7; color: #166534; border-left: 3px solid #16A34A; }
.fcnm-modal__msg.is-info     { background: var(--fcnm-bg-soft); color: #92400E; border-left: 3px solid var(--fcnm-primary); }

/* ═══════════════════════════════════════════════════════════
 *  Steps (un solo visible a la vez)
 * ═══════════════════════════════════════════════════════════ */
.fcnm-step {
  display: none;
  position: relative;
}
.fcnm-step.is-active { display: block; }

/* ═══════════════════════════════════════════════════════════
 *  STEP GATEWAY · 2 cards
 * ═══════════════════════════════════════════════════════════ */
.fcnm-cards {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
@media (min-width: 480px) {
  .fcnm-cards { grid-template-columns: 1fr 1fr; }
}

.fcnm-card {
  background: var(--fcnm-bg-card);
  border: 1.5px solid var(--fcnm-border);
  border-radius: 14px;
  padding: 18px 16px;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .1s;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fcnm-card:hover {
  border-color: var(--fcnm-primary);
  box-shadow: 0 4px 12px rgba(255,149,64,0.15);
}
.fcnm-card:active { transform: translateY(1px); }

.fcnm-card__icon {
  width: 44px;
  height: 44px;
  background: var(--fcnm-bg-soft);
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fcnm-primary);
  margin-bottom: 4px;
}
.fcnm-card__title {
  margin: 0;
  font: 700 16px/1.3 'Comfortaa', Arial, sans-serif;
  color: var(--fcnm-text);
}
.fcnm-card__desc {
  margin: 0;
  font: 400 12.5px/1.5 'Inter', Arial, sans-serif;
  color: var(--fcnm-muted);
  flex: 1;
}
.fcnm-card__cta {
  margin-top: 4px;
  font: 600 13px/1 'Inter', Arial, sans-serif;
  color: var(--fcnm-primary);
}

/* ═══════════════════════════════════════════════════════════
 *  Forms · campos
 * ═══════════════════════════════════════════════════════════ */
.fcnm-field {
  margin-bottom: 12px;
}
.fcnm-field-row {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
@media (min-width: 480px) {
  .fcnm-field-row { grid-template-columns: 1fr 1fr; }
}
.fcnm-field-row .fcnm-field { margin-bottom: 0; }

.fcnm-field label {
  display: block;
  font: 600 12.5px/1.4 'Inter', sans-serif;
  color: var(--fcnm-text);
  margin-bottom: 5px;
}
.fcnm-req {
  color: var(--fcnm-error);
  font-weight: 700;
  margin-left: 2px;
}
.fcnm-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  border: 1.5px solid var(--fcnm-border);
  border-radius: 9px;
  font: 400 14.5px/1.4 'Inter', sans-serif;
  color: var(--fcnm-text);
  background: #FFFFFF;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
.fcnm-field input::placeholder {
  color: var(--fcnm-muted-2);
  font-style: italic;
  font-size: 13.5px;
}
.fcnm-field input:focus {
  outline: none;
  border-color: var(--fcnm-primary);
  box-shadow: 0 0 0 3px rgba(255,149,64,0.15);
}

.fcnm-hint {
  display: block;
  font: 400 11.5px/1.5 'Inter', sans-serif;
  color: var(--fcnm-muted);
  margin: -4px 0 12px;
}

/* ═══════════════════════════════════════════════════════════
 *  Checkbox de consentimiento
 * ═══════════════════════════════════════════════════════════ */
.fcnm-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 6px 0 14px;
  font: 400 12px/1.5 'Inter', sans-serif;
  color: var(--fcnm-muted);
  cursor: pointer;
}
.fcnm-consent input[type="checkbox"] {
  margin-top: 2px;
  width: 16px; height: 16px;
  accent-color: var(--fcnm-primary);
  flex-shrink: 0;
}
.fcnm-consent a {
  color: var(--fcnm-primary);
  text-decoration: underline;
}
.fcnm-consent a:hover { color: var(--fcnm-primary-dark); }

/* ═══════════════════════════════════════════════════════════
 *  Submit button
 * ═══════════════════════════════════════════════════════════ */
.fcnm-submit {
  width: 100%;
  background: var(--fcnm-primary);
  color: #FFFFFF;
  border: 0;
  border-radius: 10px;
  padding: 13px 20px;
  font: 700 14.5px/1.2 'Inter', sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color .15s, transform .1s;
}
.fcnm-submit:hover  { background: var(--fcnm-primary-dark); }
.fcnm-submit:active { transform: translateY(1px); }
.fcnm-submit:disabled {
  background: #D1D5DB;
  cursor: not-allowed;
}

.fcnm-submit__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: fcnm-spin .8s linear infinite;
}
.fcnm-submit.is-loading .fcnm-submit__label   { display: none; }
.fcnm-submit.is-loading .fcnm-submit__spinner { display: inline-block; }
@keyframes fcnm-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════
 *  Footer texts (¿ya tienes cuenta? / ¿olvidaste?)
 * ═══════════════════════════════════════════════════════════ */
.fcnm-step__foot {
  margin: 14px 0 0;
  text-align: center;
  font: 400 13px/1.5 'Inter', sans-serif;
  color: var(--fcnm-muted);
}
.fcnm-step__foot a {
  color: var(--fcnm-primary);
  text-decoration: none;
  font-weight: 600;
}
.fcnm-step__foot a:hover { color: var(--fcnm-primary-dark); text-decoration: underline; }

.fcnm-step__forgot {
  margin: 8px 0 12px;
  text-align: center;
  font: 400 12.5px/1.4 'Inter', sans-serif;
}
.fcnm-step__forgot a {
  color: var(--fcnm-primary);
  text-decoration: none;
  font-weight: 500;
}
.fcnm-step__forgot a:hover { text-decoration: underline; }

.fcnm-step__hint {
  margin: 12px 0 0;
  font: 400 12px/1.5 'Inter', sans-serif;
  color: var(--fcnm-muted);
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════
 *  OTP digits grid
 * ═══════════════════════════════════════════════════════════ */
.fcnm-otp-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 0 0 14px;
}
.fcnm-otp-digit {
  width: 100%;
  height: 50px;
  text-align: center;
  font: 700 22px/1 'Inter', sans-serif;
  color: var(--fcnm-text);
  border: 1.5px solid var(--fcnm-border);
  border-radius: 10px;
  background: #FFFFFF;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
.fcnm-otp-digit:focus {
  outline: none;
  border-color: var(--fcnm-primary);
  box-shadow: 0 0 0 3px rgba(255,149,64,0.15);
}
.fcnm-otp-digit.is-filled {
  border-color: var(--fcnm-primary);
  background: var(--fcnm-bg-soft);
}

.fcnm-otp-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.fcnm-link-btn {
  background: transparent;
  border: 0;
  font: 500 12.5px/1 'Inter', sans-serif;
  color: var(--fcnm-primary);
  cursor: pointer;
  padding: 6px 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color .15s;
}
.fcnm-link-btn:hover:not(:disabled) { color: var(--fcnm-primary-dark); }
.fcnm-link-btn:disabled,
.fcnm-link-btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.fcnm-link-btn span { color: inherit; }

/* ═══════════════════════════════════════════════════════════
 *  Trust badges (footer)
 * ═══════════════════════════════════════════════════════════ */
.fcnm-trust {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--fcnm-border);
}
.fcnm-trust__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 500 11px/1 'Inter', sans-serif;
  color: var(--fcnm-muted);
}
.fcnm-trust__item svg { color: var(--fcnm-success); }

/* ═══════════════════════════════════════════════════════════
 *  Mobile tweaks
 * ═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .fcnm-modal__title    { font-size: 18px; }
  .fcnm-modal__subtitle { font-size: 13px; }
  .fcnm-card { padding: 14px 14px; }
  .fcnm-card__title { font-size: 15px; }
  .fcnm-card__desc  { font-size: 12px; }
  .fcnm-otp-digit { height: 46px; font-size: 20px; }
}
