@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800;900&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:        #8b0000;
  --brand-dark:   #6a0000;
  --brand-light:  #fff0f0;
  --text:         #1a1a1a;
  --text-muted:   #6b7280;
  --border:       #e5e7eb;
  --border-focus: #8b0000;
  --bg:           #ffffff;
  --card-bg:      #ffffff;
  --card-shadow:  0 4px 24px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  --radius:       20px;
  --radius-sm:    12px;
  --input-bg:     #f9fafb;
}

html {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(135deg, #fff8f8 0%, #fff 50%, #fffaf5 100%);
  min-height: 100dvh;
  color: var(--text);
}

body {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

/* ── Page layout ── */
.auth-page {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* ── Logo ── */
.auth-logo {
  text-align: center;
}

.auth-logo__icon {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  line-height: 1;
  margin-bottom: .25rem;
}

.auth-logo__z {
  font-size: 3rem;
  font-weight: 900;
  color: var(--brand);
  letter-spacing: -.02em;
  line-height: 1;
}

.auth-logo__rest {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.01em;
}

.auth-logo__sub {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Card ── */
.auth-card {
  width: 100%;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 2rem 2rem 1.75rem;
  border: 1px solid rgba(0,0,0,.06);
}

/* ── Tabs ── */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f3f4f6;
  border-radius: var(--radius-sm);
  padding: .25rem;
  margin-bottom: 1.75rem;
  gap: .25rem;
}

.auth-tab {
  padding: .55rem .75rem;
  border: none;
  background: transparent;
  border-radius: calc(var(--radius-sm) - .2rem);
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
}

.auth-tab.is-active {
  background: var(--bg);
  color: var(--brand);
  box-shadow: 0 1px 6px rgba(0,0,0,.1);
}

/* ── Error banner ── */
.auth-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  font-size: .88rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  border-left: 3px solid #ef4444;
}

/* ── Form ── */
.auth-form {
  display: none;
  flex-direction: column;
  gap: 1.1rem;
}

.auth-form.is-active {
  display: flex;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.auth-field label {
  font-size: .83rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .01em;
}

.auth-field__wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-field__icon {
  position: absolute;
  left: .875rem;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.auth-field input {
  width: 100%;
  padding: .75rem .875rem .75rem 2.5rem;
  background: var(--input-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .95rem;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s, background .15s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.auth-field input::placeholder {
  color: #b0b7c3;
}

.auth-field input:focus {
  border-color: var(--border-focus);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(139, 0, 0, .1);
}

/* Password toggle button */
.auth-field__toggle {
  position: absolute;
  right: .875rem;
  background: none;
  border: none;
  padding: .25rem;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: color .15s;
}

.auth-field__toggle:hover { color: var(--text); }

.auth-field__toggle svg {
  width: 1.1rem;
  height: 1.1rem;
}

/* ── Buttons ── */
.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  width: 100%;
  padding: .85rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all .18s ease;
  white-space: nowrap;
  letter-spacing: .01em;
}

.auth-btn--primary {
  background: var(--brand);
  color: #fff;
  margin-top: .4rem;
}

.auth-btn--primary:hover:not(:disabled) {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(139, 0, 0, .3);
}

.auth-btn--primary:active:not(:disabled) {
  transform: translateY(0);
}

.auth-btn--primary:disabled {
  opacity: .65;
  cursor: not-allowed;
}

/* Spinner inside button */
.auth-btn__spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .65s linear infinite;
}

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

.auth-btn--google {
  background: #fff;
  color: #3c4043;
  border: 1.5px solid var(--border);
  font-weight: 600;
  margin-top: 0;
}

.auth-btn--google:hover {
  background: #f8f9fa;
  border-color: #c7cacd;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

.auth-btn__google-icon {
  width: 1.2rem;
  height: 1.2rem;
  flex-shrink: 0;
}

/* ── Divider ── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: .875rem;
  margin: 1.25rem 0 1rem;
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Footer ── */
.auth-footer {
  font-size: .78rem;
  color: var(--text-muted);
  text-align: center;
}

.auth-vizra-footer {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
  opacity: 0.8;
}
.auth-vizra-footer a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s;
}
.auth-vizra-footer a:hover { color: #ea580c; text-decoration: underline; }
.auth-vizra-footer__tagline { font-style: italic; color: var(--text-muted); }

/* ── Mobile tweaks ── */
@media (max-width: 480px) {
  .auth-card {
    padding: 1.5rem 1.25rem 1.5rem;
    border-radius: 16px;
  }

  .auth-logo__z    { font-size: 2.5rem; }
  .auth-logo__rest { font-size: 1.5rem; }
}
