:root {
  --auth-bg: #f4f2ef;
  --auth-surface: #ffffff;
  --auth-text: #121212;
  --auth-muted: #737373;
  --auth-border: #e4e0da;
  --auth-accent: #121212;
  --auth-accent-hover: #2a2a2a;
  --auth-focus: rgba(18, 18, 18, 0.08);
  --auth-error-bg: #fef3f2;
  --auth-error: #b42318;
  --auth-success-bg: #ecfdf3;
  --auth-success: #027a48;
  --auth-radius: 14px;
  --auth-shadow: 0 24px 64px rgba(18, 18, 18, 0.08), 0 4px 16px rgba(18, 18, 18, 0.04);
}

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

.auth-page {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: var(--auth-text);
  background: var(--auth-bg);
  -webkit-font-smoothing: antialiased;
}

.auth-page::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(18, 18, 18, 0.04), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(180, 160, 140, 0.12), transparent),
    radial-gradient(ellipse 50% 35% at 0% 80%, rgba(180, 160, 140, 0.08), transparent);
}

.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: clamp(1rem, 3vw, 2rem);
}

.auth-shell__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 560px;
  width: 100%;
  margin: 0 auto 1.5rem;
}

.auth-shell__logo {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: var(--auth-text);
  text-decoration: none;
}

.auth-shell__back {
  font-size: 0.8125rem;
  color: var(--auth-muted);
  text-decoration: none;
  transition: color 0.15s;
}

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

.auth-shell__main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0 2rem;
}

.auth-panel {
  width: 100%;
  max-width: 420px;
  padding: clamp(1.5rem, 4vw, 2rem);
  background: var(--auth-surface);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow);
}

.auth-panel--wide {
  max-width: 520px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.3rem;
  margin-bottom: 1.75rem;
  background: #f7f5f2;
  border-radius: 10px;
}

.auth-tabs__link {
  display: block;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  color: var(--auth-muted);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

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

.auth-tabs__link.is-active {
  background: var(--auth-surface);
  color: var(--auth-text);
  box-shadow: 0 2px 8px rgba(18, 18, 18, 0.06);
}

.auth-panel__head {
  margin-bottom: 1.5rem;
}

.auth-panel__title {
  margin: 0 0 0.4rem;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.65rem, 4vw, 2rem);
  font-weight: 600;
  line-height: 1.15;
}

.auth-panel__lead {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--auth-muted);
}

.auth-panel__note {
  margin: -0.35rem 0 1.1rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--auth-muted);
}

.auth-alert {
  padding: 0.8rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: 10px;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.auth-alert--error {
  background: var(--auth-error-bg);
  color: var(--auth-error);
  border: 1px solid #fecdca;
}

.auth-alert--success {
  background: var(--auth-success-bg);
  color: var(--auth-success);
  border: 1px solid #abefc6;
}

.auth-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.82rem 1rem;
  border: 1px solid var(--auth-border);
  border-radius: 10px;
  background: var(--auth-surface);
  color: var(--auth-text);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.auth-google-btn:hover {
  background: #fafaf9;
  border-color: #ccc8c2;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.15rem 0;
  color: var(--auth-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

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

.auth-form { margin-top: 0; }

.auth-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 0.85rem;
}

.auth-field {
  margin-bottom: 1rem;
}

.auth-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--auth-text);
}

.auth-field input {
  width: 100%;
  padding: 0.78rem 0.95rem;
  border: 1px solid var(--auth-border);
  border-radius: 10px;
  background: #fafaf9;
  font-size: 0.9375rem;
  color: var(--auth-text);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

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

.auth-field input:hover {
  border-color: #d4d0c9;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--auth-accent);
  background: #fff;
  box-shadow: 0 0 0 4px var(--auth-focus);
}

.auth-field__pw {
  position: relative;
}

.auth-field__pw input {
  padding-right: 4.25rem;
}

.auth-pw-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: var(--auth-muted);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.2rem;
}

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

.auth-field__hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  color: var(--auth-muted);
}

.auth-form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.8125rem;
}

.auth-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--auth-muted);
  line-height: 1.45;
  font-size: 0.8125rem;
}

.auth-check input {
  margin-top: 0.2rem;
  accent-color: var(--auth-accent);
  flex-shrink: 0;
}

.auth-check--block {
  display: flex;
  margin-bottom: 0.6rem;
}

.auth-check a {
  color: var(--auth-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-consents {
  margin: 0.25rem 0 1.25rem;
  padding: 0.9rem 1rem;
  background: #fafaf9;
  border: 1px solid var(--auth-border);
  border-radius: 10px;
}

.auth-link {
  color: var(--auth-text);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.auth-submit {
  width: 100%;
  padding: 0.92rem 1rem;
  border: none;
  border-radius: 10px;
  background: var(--auth-accent);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, opacity 0.15s;
}

.auth-submit:hover {
  background: var(--auth-accent-hover);
  transform: translateY(-1px);
}

.auth-submit:active {
  transform: translateY(0);
}

.auth-submit:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.auth-panel__footer {
  margin: 1.35rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--auth-border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--auth-muted);
}

.auth-panel__footer a {
  color: var(--auth-text);
  font-weight: 600;
  text-decoration: none;
}

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

.auth-shell__trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem 1rem;
  padding: 1rem 0 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--auth-muted);
}

.auth-shell__trust-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #c4c0b8;
}

@media (max-width: 560px) {
  .auth-shell {
    padding: 1rem;
  }

  .auth-panel {
    padding: 1.25rem;
    border-radius: 12px;
  }

  .auth-form__grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .auth-form__row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }
}

@media (max-width: 380px) {
  .auth-shell__trust {
    font-size: 0.65rem;
    gap: 0.5rem 0.75rem;
  }
}
