/* ============================================================
   signup.css – ZabiTech signup page
   Depends on css/style.css for tokens, header, footer, buttons.
   Handles: auth-card layout, google button, or-divider,
   field styling, password strength meter, terms checkbox,
   block submit button, error/hint/success states.
   ============================================================ */

/* ============================================================
   PAGE LAYOUT
   ============================================================ */
.signup-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  background: linear-gradient(145deg, #e9f3ff, #ffffff);
  min-height: calc(100vh - var(--header-height, 70px));
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 18px;
  box-shadow:
    0 20px 48px -20px rgba(15, 23, 42, .18),
    0 2px 8px rgba(15, 23, 42, .04);
  padding: 40px 36px 32px;
  animation: signupFadeIn .5s cubic-bezier(.2, .8, .2, 1);
}

@keyframes signupFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   HEAD
   ============================================================ */
.auth-head {
  text-align: center;
  margin-bottom: 24px;
}

.auth-brand {
  display: inline-block;
  padding: 5px 12px;
  margin-bottom: 16px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary, #0078d4);
  background: var(--primary-soft, rgba(0, 120, 212, .1));
  border: 1px solid rgba(0, 120, 212, .18);
  border-radius: 999px;
}

.auth-title {
  font-size: clamp(1.4rem, 3vw, 1.65rem);
  font-weight: 700;
  color: var(--primary, #0078d4);
  letter-spacing: -.01em;
  margin: 0 0 10px;
  line-height: 1.25;
}

.auth-sub {
  color: var(--muted, #6b7280);
  font-size: .95rem;
  margin: 0 auto;
  line-height: 1.55;
  max-width: 380px;
}

/* ============================================================
   FIELDS
   ============================================================ */
.auth-card .field {
  text-align: left;
  margin-bottom: 16px;
}

.auth-card .field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2, #334155);
  margin-bottom: 6px;
}

.input-wrap { position: relative; }

.auth-card .field input {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--text, #1f2937);
  background: #fff;
  border: 1px solid var(--border-2, #cbd5e1);
  border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.auth-card .field input::placeholder {
  color: var(--muted-2, #94a3b8);
}

.auth-card .field input:hover:not(:focus) {
  border-color: #b8c2cc;
}

.auth-card .field input:focus {
  outline: none;
  border-color: var(--primary, #0078d4);
  box-shadow: 0 0 0 3px var(--primary-soft, rgba(0, 120, 212, .14));
}

.auth-card .field input[aria-invalid="true"] {
  border-color: #f87171;
  background: #fffafa;
}
.auth-card .field input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .14);
}

/* Password field — leave room for the Show/Hide button */
.auth-card .field input.has-toggle {
  padding-right: 72px;
}

.toggle-pw {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--primary, #0078d4);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s ease;
}
.toggle-pw:hover {
  background: var(--primary-soft, rgba(0, 120, 212, .08));
}
.toggle-pw:focus-visible {
  outline: 2px solid var(--primary, #0078d4);
  outline-offset: 1px;
}

/* ============================================================
   PASSWORD STRENGTH METER
   ============================================================ */
.strength {
  display: flex;
  gap: 5px;
  margin-top: 10px;
}

.strength span {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--border, #e5e7eb);
  transition: background .25s ease;
}

.strength[data-score="1"] span.on { background: #ef4444; } /* weak */
.strength[data-score="2"] span.on { background: #f59e0b; } /* fair */
.strength[data-score="3"] span.on { background: #3b82f6; } /* good */
.strength[data-score="4"] span.on { background: #10b981; } /* strong */

/* ============================================================
   HINTS & ERRORS
   ============================================================ */
.auth-card .hint {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--muted, #6b7280);
  line-height: 1.45;
  text-align: left;
}

.auth-card .error {
  display: none;
  margin: 6px 0 0;
  font-size: 12.5px;
  font-weight: 500;
  color: #dc2626;
  text-align: left;
  line-height: 1.45;
}
.auth-card .error.is-visible { display: block; }

/* ============================================================
   TERMS CHECKBOX
   ============================================================ */
.terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 6px 0 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted, #6b7280);
  cursor: pointer;
  text-align: left;
  user-select: none;
}

.terms input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex: none;
  margin: 2px 0 0;
  accent-color: var(--primary, #0078d4);
  cursor: pointer;
}

.terms a {
  color: var(--primary, #0078d4);
  font-weight: 600;
  text-decoration: none;
}
.terms a:hover { text-decoration: underline; }

/* ============================================================
   SUBMIT BUTTON (block modifier)
   ============================================================ */
.auth-card .btn-primary.btn-block {
  width: 100%;
  padding: 13px 20px;
  font-size: 15.5px;
  border-radius: 10px;
  margin-top: 4px;
  box-shadow: 0 6px 18px -6px rgba(0, 120, 212, .55);
}
.auth-card .btn-primary.btn-block:hover:not(:disabled) {
  box-shadow: 0 10px 24px -8px rgba(0, 120, 212, .7);
  transform: translateY(-1px);
}
.auth-card .btn-primary.btn-block:active:not(:disabled) {
  transform: translateY(1px);
}
.auth-card .btn-primary.btn-block:disabled {
  cursor: not-allowed;
  opacity: .72;
  transform: none;
  box-shadow: none;
}

/* Button spinner */
.spinner {
  display: none;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: signupSpin .65s linear infinite;
  flex: none;
}
.btn-primary[aria-busy="true"] .spinner { display: inline-block; }

@keyframes signupSpin { to { transform: rotate(360deg); } }

/* ============================================================
   GOOGLE BUTTON
   ============================================================ */
.btn-google {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  background: #fff;
  color: #1f2937;
  border: 1px solid #dadce0;
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.btn-google:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #c7cbd1;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}
.btn-google:active:not(:disabled) { background: #f1f5f9; }
.btn-google:disabled {
  cursor: not-allowed;
  opacity: .65;
}
.btn-google:focus-visible {
  outline: 2px solid var(--primary, #0078d4);
  outline-offset: 2px;
}
.btn-google svg { flex: none; }

/* ============================================================
   "OR" DIVIDER
   ============================================================ */
.or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--muted-2, #94a3b8);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.or-divider::before,
.or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border, #e5e7eb);
}
.or-divider span { flex: none; }

/* ============================================================
   BOTTOM TEXT
   ============================================================ */
.auth-alt {
  margin: 22px 0 0;
  font-size: 14px;
  color: var(--muted, #6b7280);
  text-align: center;
}
.auth-alt a {
  color: var(--primary, #0078d4);
  font-weight: 700;
  text-decoration: none;
}
.auth-alt a:hover { text-decoration: underline; }

.auth-status {
  margin: 14px 0 0;
  font-size: 13.5px;
  color: var(--primary, #0078d4);
  min-height: 18px;
  text-align: center;
  line-height: 1.45;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .signup-page {
    padding: 40px 16px;
    align-items: flex-start;
  }
  .auth-card {
    padding: 28px 22px 24px;
    border-radius: 16px;
  }
  .auth-head { margin-bottom: 20px; }
  .auth-title { font-size: 1.35rem; }
  .auth-sub { font-size: .92rem; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}