/**
 * TruOath Authentication Styles
 * Phone OTP + Google Sign-In — Aesop-inspired design
 */

/* ==========================================================================
   My Account Login Page
   ========================================================================== */

.truoath-auth {
  max-width: 420px;
  margin: 160px auto 80px;
  padding: 0 24px;
}

.truoath-auth__heading {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: 400;
  color: var(--truoath-black);
  margin-bottom: 8px;
  line-height: 1.15;
}

.truoath-auth__subtext {
  font-size: var(--text-sm);
  color: var(--truoath-warm-grey);
  margin-bottom: 40px;
  line-height: 1.6;
}

/* Phone Input Row */
.truoath-auth__phone-row {
  display: flex;
  align-items: stretch;
  margin-bottom: 16px;
}

.truoath-auth__prefix {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--truoath-bg-warm);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-right: none;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--truoath-warm-grey);
  font-weight: 500;
}

.truoath-auth__phone-input {
  flex: 1;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-right: none;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--truoath-black);
  outline: none;
  border-radius: 0;
  -webkit-appearance: none;
}

.truoath-auth__phone-input:focus {
  border-color: var(--truoath-black);
}

.truoath-auth__phone-input::placeholder {
  color: rgba(0, 0, 0, 0.35);
}

.truoath-auth__send-btn {
  padding: 16px 24px;
  background: var(--truoath-black);
  color: var(--truoath-cream);
  border: 1px solid var(--truoath-black);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 0;
  transition: opacity 0.2s;
}

.truoath-auth__send-btn:hover {
  opacity: 0.8;
}

.truoath-auth__send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* OTP Input Row */
.truoath-auth__otp-section {
  margin-bottom: 20px;
}

.truoath-auth__otp-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--truoath-warm-grey);
  margin-bottom: 10px;
  display: block;
}

.truoath-auth__otp-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.truoath-auth__otp-digit {
  width: 48px;
  height: 54px;
  text-align: center;
  font-size: var(--text-xl);
  font-family: var(--font-body);
  font-weight: 500;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 0;
  outline: none;
  color: var(--truoath-black);
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.truoath-auth__otp-digit:focus {
  border-color: var(--truoath-black);
}

.truoath-auth__resend {
  font-size: var(--text-xs);
  color: var(--truoath-warm-grey);
}

.truoath-auth__resend-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--truoath-black);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  font-size: var(--text-xs);
  font-family: var(--font-body);
}

.truoath-auth__resend-btn:disabled {
  color: var(--truoath-warm-grey);
  text-decoration: none;
  cursor: not-allowed;
}

.truoath-auth__verify-btn {
  width: 100%;
  padding: 16px;
  background: var(--truoath-black);
  color: var(--truoath-cream);
  border: 1px solid var(--truoath-black);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0;
  transition: opacity 0.2s;
}

.truoath-auth__verify-btn:hover {
  opacity: 0.8;
}

.truoath-auth__verify-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Divider */
.truoath-auth__divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 32px 0;
  color: var(--truoath-warm-grey);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.truoath-auth__divider::before,
.truoath-auth__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
}

/* Google Button */
.truoath-auth__google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 24px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--truoath-black);
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s;
}

.truoath-auth__google-btn:hover {
  background: var(--truoath-bg-warm);
  border-color: rgba(0, 0, 0, 0.25);
}

.truoath-auth__google-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Google Button Container (rendered by GSI library) */
.truoath-auth__google-wrap {
  display: flex;
  justify-content: center;
}

.truoath-auth__google-wrap iframe {
  border-radius: 0 !important;
}

/* Message */
.truoath-auth__msg {
  margin-top: 16px;
  font-size: var(--text-sm);
  line-height: 1.5;
  min-height: 20px;
}

.truoath-auth__msg--success {
  color: #4a5d4e;
}

.truoath-auth__msg--error {
  color: #ca432f;
}

/* ==========================================================================
   Thank You Page Phone Link
   ========================================================================== */

.truoath-post-purchase-link {
  background: var(--truoath-bg-warm);
  padding: 28px;
  margin: 24px 0;
  border-left: 2px solid var(--truoath-tan-warm);
}

.truoath-post-purchase-link h3 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 400;
  margin-bottom: 6px;
}

.truoath-post-purchase-link p {
  font-size: var(--text-sm);
  color: var(--truoath-warm-grey);
  margin-bottom: 20px;
}

.truoath-ppl__phone-row,
.truoath-ppl__otp-row {
  display: flex;
  gap: 0;
  align-items: stretch;
}

.truoath-ppl__prefix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-right: none;
  font-size: var(--text-sm);
  color: var(--truoath-warm-grey);
}

.truoath-ppl__phone-row input,
.truoath-ppl__otp-row input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-right: none;
  font-size: var(--text-sm);
  font-family: var(--font-body);
  border-radius: 0;
  outline: none;
}

.truoath-ppl__phone-row input:focus,
.truoath-ppl__otp-row input:focus {
  border-color: var(--truoath-black);
}

.truoath-ppl__phone-row .btn,
.truoath-ppl__otp-row .btn {
  padding: 14px 20px;
  font-size: 11px;
  white-space: nowrap;
}

.truoath-ppl__msg {
  margin-top: 12px;
  font-size: var(--text-sm);
  min-height: 18px;
}

/* Responsive */
@media (max-width: 480px) {
  .truoath-auth {
    margin-top: 140px;
  }

  .truoath-auth__otp-row {
    gap: 6px;
  }

  .truoath-auth__otp-digit {
    width: 42px;
    height: 48px;
    font-size: var(--text-lg);
  }

  .truoath-ppl__phone-row,
  .truoath-ppl__otp-row {
    flex-direction: column;
    gap: 8px;
  }

  .truoath-ppl__prefix {
    display: none;
  }

  .truoath-ppl__phone-row input,
  .truoath-ppl__otp-row input {
    border-right: 1px solid rgba(0, 0, 0, 0.12);
  }
}
