/* Customer auth — isolated from checkout #figv8root to avoid layout conflicts */
#customer-auth-root {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: linear-gradient(180deg, #f0f4ff 0%, #f8fafc 45%, #fff 100%);
  padding: 1.25rem 1rem 2.5rem;
  min-height: 55vh;
  color: var(--commerce-navy, #0A2472);
}

#customer-auth-root .ca-wrap {
  max-width: 420px;
  margin: 0 auto;
}

#customer-auth-root .ca-wrap--wide {
  max-width: 720px;
}

#customer-auth-root .ca-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(10, 36, 114, 0.1);
  box-shadow: 0 8px 28px rgba(10, 36, 114, 0.08);
  padding: 1.35rem 1.25rem;
}

#customer-auth-root .ca-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0 0 0.25rem;
  color: var(--commerce-navy, #0A2472);
}

#customer-auth-root .ca-sub {
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.45;
  margin: 0 0 1rem;
}

#customer-auth-root .ca-form {
  width: 100%;
  max-width: 100%;
}

#customer-auth-root .ca-form .ca-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  min-width: 0;
  width: 100%;
}

#customer-auth-root .ca-form .ca-field:last-of-type {
  margin-bottom: 0;
}

#customer-auth-root .ca-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--commerce-navy, #0A2472);
  margin: 0;
  line-height: 1.3;
}

#customer-auth-root .ca-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.1rem;
}

#customer-auth-root .ca-label-row label {
  margin-bottom: 0;
}

#customer-auth-root .ca-forgot-link {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--commerce-coral, #E63946);
  text-decoration: none;
  white-space: nowrap;
}

#customer-auth-root .ca-forgot-link:hover {
  text-decoration: underline;
}

#customer-auth-root .ca-form input:not([type="hidden"]) {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: block;
  border: 2px solid #dde6f5;
  border-radius: 12px;
  padding: 0.72rem 0.85rem;
  font-size: 0.95rem;
  line-height: 1.4;
  min-height: 46px;
  font-family: inherit;
  background: #fff;
  color: #0f172a;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

#customer-auth-root .ca-form input::placeholder {
  color: #94a3b8;
  opacity: 1;
}

#customer-auth-root .ca-form input:hover:not(:focus) {
  border-color: #94a3b8;
}

#customer-auth-root .ca-form input:focus {
  outline: none;
  border-color: var(--commerce-navy, #0A2472);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(10, 36, 114, 0.1);
}

/* Legacy field styles outside .ca-form */
#customer-auth-root .ca-field {
  margin-bottom: 0.8rem;
}

#customer-auth-root .ca-field input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: block;
  border: 2px solid #dde6f5;
  border-radius: 12px;
  padding: 0.72rem 0.85rem;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: #0f172a;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

#customer-auth-root .ca-field input:focus {
  outline: none;
  border-color: var(--commerce-navy, #0A2472);
  box-shadow: 0 0 0 4px rgba(10, 36, 114, 0.1);
}

#customer-auth-root .ca-pw-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
}

#customer-auth-root .ca-pw-wrap input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding-right: 2.75rem;
}

#customer-auth-root .ca-pw-toggle {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.15s, background 0.15s;
}

#customer-auth-root .ca-pw-toggle:hover {
  color: var(--commerce-navy, #0A2472);
  background: #f1f5f9;
}

#customer-auth-root .ca-pw-toggle:focus-visible {
  outline: 2px solid var(--commerce-navy, #0A2472);
  outline-offset: 2px;
}

#customer-auth-root .ca-field-hint {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.3rem;
}

#customer-auth-root .ca-field-error {
  font-size: 0.75rem;
  color: var(--commerce-coral, #E63946);
  margin-top: 0.3rem;
  display: none;
}

#customer-auth-root .ca-field-error.is-visible {
  display: block;
}

#customer-auth-root .ca-row2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  width: 100%;
  margin-bottom: 0.85rem;
}

#customer-auth-root .ca-row2 > .ca-field {
  margin-bottom: 0;
}

#customer-auth-root .ca-form .ca-btn {
  margin-top: 1rem;
}

#customer-auth-root .ca-btn {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--commerce-coral, #E63946), var(--commerce-coral-dark, #c72535));
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(230, 57, 70, 0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}

#customer-auth-root .ca-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(230, 57, 70, 0.38);
}

#customer-auth-root .ca-footer {
  text-align: center;
  margin-top: 1.1rem;
  font-size: 0.85rem;
  color: #64748b;
}

#customer-auth-root .ca-footer a {
  color: var(--commerce-coral, #E63946);
  font-weight: 600;
  text-decoration: none;
}

#customer-auth-root .ca-footer--muted {
  margin-top: 0.6rem;
  font-size: 0.78rem;
}

#customer-auth-root .ca-footer--muted a {
  color: #64748b;
  font-weight: 500;
}

#customer-auth-root .ca-msgs {
  margin-bottom: 0.85rem;
}

#customer-auth-root .ca-msg {
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  font-size: 0.84rem;
  margin-bottom: 0.45rem;
}

#customer-auth-root .ca-msg--success { background: #dcfce7; color: #166534; }
#customer-auth-root .ca-msg--error { background: #fee2e2; color: #991b1b; }
#customer-auth-root .ca-msg--info,
#customer-auth-root .ca-msg--warning { background: #eff6ff; color: #1e40af; }

#customer-auth-root .ca-order-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

#customer-auth-root .ca-order-banner i {
  color: var(--commerce-navy, #0A2472);
  margin-top: 0.15rem;
}

#customer-auth-root .ca-order-banner strong {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 0.15rem;
}

#customer-auth-root .ca-order-banner span {
  font-size: 0.76rem;
  color: #64748b;
}

#customer-auth-root .ca-verify-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  background: #eef2ff;
  color: var(--commerce-navy, #0A2472);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

#customer-auth-root .ca-code-input {
  text-align: center;
  letter-spacing: 0.35em;
  font-weight: 700;
  font-size: 1.2rem !important;
}

#customer-auth-root .ca-resend {
  margin-top: 0.5rem;
  border: none;
  background: none;
  color: var(--commerce-coral, #E63946);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  display: block;
  width: 100%;
  text-align: center;
}

#customer-auth-root .ca-resend:disabled {
  color: #94a3b8;
  cursor: not-allowed;
}

#customer-auth-root .ca-card--center {
  text-align: center;
}

#customer-auth-root .ca-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #64748b;
  font-size: 0.85rem;
  text-decoration: none;
  margin-bottom: 0.85rem;
}

#customer-auth-root .ca-back:hover {
  color: var(--commerce-navy, #0A2472);
}

#customer-auth-root .ca-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

#customer-auth-root .ca-btn-outline {
  border: 1.5px solid #e2e8f0;
  background: #fff;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  color: #64748b;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.82rem;
}

#customer-auth-root .ca-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.9rem;
  background: #f1f5f9;
  color: var(--commerce-navy, #0A2472);
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none;
}

#customer-auth-root .ca-order-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid #f1f5f9;
  text-decoration: none;
  color: inherit;
}

#customer-auth-root .ca-order-row:hover {
  background: #f8fafc;
}

@media (max-width: 480px) {
  #customer-auth-root {
    padding: 0.75rem 0.75rem 2rem;
  }

  #customer-auth-root .ca-card {
    padding: 1.15rem 1rem;
  }

  #customer-auth-root .ca-row2 {
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: 0;
  }

  #customer-auth-root .ca-row2 > .ca-field {
    margin-bottom: 0.85rem;
  }

  #customer-auth-root .ca-row2 > .ca-field:last-child {
    margin-bottom: 0;
  }
}
