/*
 * WhatsApp Cloud Engine — auth pages (sign in / sign up / forgot password).
 * Hand-written CSS, deliberately separate from techmits_ruby's compiled
 * Tailwind bundle and from the blog's stylesheet — see CLAUDE.md
 * "UI & Branding: keep this engine's assets separate". Colors match the
 * main site's documented WCAG-AA palette (see techmits_ruby's CLAUDE.md
 * "Color standards") so this still *looks* like the same product.
 */

:root {
  --wa-navy: #0d1b3e;
  --wa-orange-700: #c2410c;
  --wa-orange-800: #9a3412;
  --wa-gray-600: #4b5563;
  --wa-gray-900: #111827;
  --wa-green-700: #15803d;
  --wa-red-700: #b91c1c;
  --wa-border: #e5e7eb;
  --wa-bg: #f9fafb;
  --wa-radius: 0.75rem;
  --wa-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(13, 27, 62, 0.08);
}

* {
  box-sizing: border-box;
}

body.wa-auth {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--wa-bg);
  color: var(--wa-gray-900);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ─────────────────────────────────────────────────────────── */

.wa-auth-header {
  background: var(--wa-navy);
  padding: 1.25rem 1.5rem;
}

.wa-auth-header__inner {
  max-width: 30rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.wa-auth-logo {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border-radius: 0.5rem;
  padding: 0.4rem 0.75rem;
  box-shadow: var(--wa-shadow);
}

.wa-auth-logo img {
  max-height: 2rem;
  width: auto;
  display: block;
}

.wa-auth-logo-text {
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

/* ── Main / card ────────────────────────────────────────────────────── */

.wa-auth-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 1.25rem;
}

.wa-auth-card {
  width: 100%;
  max-width: 26rem;
  background: #fff;
  border: 1px solid var(--wa-border);
  border-radius: var(--wa-radius);
  box-shadow: var(--wa-shadow);
  padding: 2.25rem 2rem;
  animation: wa-card-in 0.35s ease-out;
}

@keyframes wa-card-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wa-auth-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--wa-orange-700);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.5rem;
}

.wa-auth-card h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.375rem;
  color: var(--wa-gray-900);
}

.wa-auth-subtitle {
  color: var(--wa-gray-600);
  font-size: 0.9rem;
  margin: 0 0 1.75rem;
  line-height: 1.5;
}

/* ── Icon badge (confirmation-pending / status pages) ──────────────────── */

.wa-auth-icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: #fff7ed;
  color: var(--wa-orange-700);
  font-size: 1.75rem;
}

/* ── Form ───────────────────────────────────────────────────────────── */

.wa-field {
  margin-bottom: 1.25rem;
}

.wa-field label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--wa-gray-900);
  margin-bottom: 0.375rem;
}

.wa-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.wa-input-icon {
  position: absolute;
  left: 0.85rem;
  color: #9ca3af;
  font-size: 1.05rem;
  pointer-events: none;
  display: flex;
}

.wa-field input[type="email"],
.wa-field input[type="password"],
.wa-field input[type="text"] {
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 2.5rem;
  border: 1px solid var(--wa-border);
  border-radius: 0.5rem;
  font-size: 0.95rem;
  color: var(--wa-gray-900);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wa-field input:focus {
  outline: none;
  border-color: var(--wa-orange-700);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.12);
}

.wa-field input.wa-has-toggle {
  padding-right: 2.5rem;
}

.wa-password-toggle {
  position: absolute;
  right: 0.6rem;
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.35rem;
  display: flex;
  align-items: center;
  font-size: 1.05rem;
  border-radius: 0.375rem;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.wa-password-toggle:hover {
  color: var(--wa-gray-900);
  background: var(--wa-bg);
}

.wa-password-toggle:focus-visible {
  outline: 2px solid var(--wa-orange-700);
  outline-offset: 1px;
}

/* ── Buttons ────────────────────────────────────────────────────────── */

.wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--wa-orange-700);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.wa-btn:hover {
  background: var(--wa-orange-800);
}

.wa-btn:active {
  transform: translateY(1px);
}

.wa-btn:focus-visible {
  outline: 2px solid var(--wa-navy);
  outline-offset: 2px;
}

.wa-btn[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ── Links / footer rows ────────────────────────────────────────────── */

.wa-auth-links {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--wa-border);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.875rem;
  text-align: center;
  color: var(--wa-gray-600);
}

.wa-auth-links a {
  color: var(--wa-orange-700);
  font-weight: 600;
  text-decoration: none;
}

.wa-auth-links a:hover {
  text-decoration: underline;
}

.wa-auth-footer {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  color: #9ca3af;
  font-size: 0.8rem;
}

/* ── Alerts / flash / validation errors ─────────────────────────────── */

.wa-flash {
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  animation: wa-shake 0.3s ease;
}

.wa-flash--alert {
  background: #fef2f2;
  color: var(--wa-red-700);
  border: 1px solid #fecaca;
}

.wa-flash--notice {
  background: #f0fdf4;
  color: var(--wa-green-700);
  border: 1px solid #bbf7d0;
}

@keyframes wa-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

.wa-error-list {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.5rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}

.wa-error-list p {
  margin: 0 0 0.4rem;
  color: var(--wa-red-700);
  font-weight: 600;
  font-size: 0.85rem;
}

.wa-error-list ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--wa-red-700);
  font-size: 0.825rem;
}

/* ── Password strength hint ─────────────────────────────────────────── */

.wa-hint {
  font-size: 0.775rem;
  color: #9ca3af;
  margin-top: 0.375rem;
}

.wa-strength {
  height: 3px;
  border-radius: 2px;
  background: var(--wa-border);
  margin-top: 0.5rem;
  overflow: hidden;
}

.wa-strength__bar {
  height: 100%;
  width: 0%;
  background: var(--wa-red-700);
  transition: width 0.2s ease, background-color 0.2s ease;
}
