/* Auth pages: login, signup, reset-password — SkrivSikkert Centered Layout */

/* No body min-height override needed — .auth-page height:100vh + overflow:hidden
   already prevents scrollbar regardless of body min-height from reset.css */

.auth-page {
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FAFAF8;
  padding: var(--space-5);
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
}

/* ─── Centered card ─── */
.auth-card {
  width: 100%;
  max-width: 400px;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
}

/* Logo icon — centered above title */
.auth-logo-icon {
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto var(--space-3);
  object-fit: contain;
}

.auth-title {
  text-align: center;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
  letter-spacing: -0.3px;
}

.auth-subtitle {
  text-align: center;
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-5);
  line-height: 1.5;
}

/* ─── Google / OAuth button ─── */
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  height: 44px;
  background: var(--color-card);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-family);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.google-btn:hover {
  border-color: var(--color-border);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}

.google-btn svg {
  width: 20px;
  height: 20px;
}

/* ─── Divider ─── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-4) 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

/* ─── Form ─── */
.auth-form {
  display: flex;
  flex-direction: column;
}

.form-group {
  margin-bottom: var(--space-3);
}

.form-label {
  display: block;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-1);
}

.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-label-row a {
  font-size: var(--font-size-base);
  color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
}

.form-label-row a:hover {
  text-decoration: underline;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  height: 44px;
  padding: 10px 14px;
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  background: var(--color-card);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--color-border);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}

.auth-form input::placeholder {
  color: var(--color-text-tertiary, #a0a4b8);
}

.password-wrap {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1);
  color: var(--color-text-secondary);
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

/* ─── Checkbox ─── */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
  min-height: 44px;
  cursor: pointer;
}

.form-check-input {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--color-border);
  border-radius: 5px;
  background: var(--color-card);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  flex-shrink: 0;
}

.form-check-input:checked {
  background: var(--color-primary);
  border-color: var(--color-border);
}

.form-check-input:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.form-check-input:focus-visible {
  outline: 2px solid var(--color-border);
  outline-offset: 2px;
}

.form-check-label {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
}

.form-check-label a {
  color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
}

/* ─── Submit button — clean fill, no outline ─── */
.auth-form .btn,
.auth-form .btn.btn-primary {
  width: 100%;
  height: 44px;
  border-radius: var(--radius-md);
  margin-top: var(--space-2);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  font-family: var(--font-family);
  letter-spacing: 0.2px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  outline: none;
  box-shadow: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.auth-form .btn:hover,
.auth-form .btn.btn-primary:hover {
  opacity: 0.88;
  background: var(--color-primary);
  color: #fff;
  border: none;
  outline: none;
  box-shadow: none;
}

.auth-form .btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ─── Message (success / error) ─── */
.auth-message {
  text-align: center;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  margin-top: var(--space-3);
  display: none;
}

.auth-message.success {
  display: block;
  background: var(--color-success-light);
  color: var(--color-success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.auth-message.error {
  display: block;
  background: var(--color-error-light);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ─── Links ─── */
.auth-links {
  text-align: center;
  margin-top: var(--space-4);
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
}

.auth-links a {
  color: var(--color-primary);
  font-weight: var(--font-weight-bold);
}

.auth-links a:hover {
  text-decoration: underline;
}

/* ─── Footer — pinned to bottom of viewport ─── */
.auth-footer-inline,
.auth-footer {
  position: absolute;
  bottom: var(--space-4);
  left: 0;
  right: 0;
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.auth-footer-inline a,
.auth-footer a {
  color: var(--color-text-secondary);
  text-decoration: none;
}

.auth-footer-inline a:hover,
.auth-footer a:hover {
  color: var(--color-primary);
}

/* ─── Link touch targets ─── */
.auth-links a,
.form-label-row a {
  display: inline-block;
  padding: var(--space-2) 0;
  min-height: 44px;
  line-height: 44px;
}

.auth-footer-inline a,
.auth-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 8px;
}

/* ─── Dark mode ─── */
[data-theme="dark"] .auth-page {
  background: var(--color-bg);
}

[data-theme="dark"] .auth-form input[type="text"],
[data-theme="dark"] .auth-form input[type="email"],
[data-theme="dark"] .auth-form input[type="password"] {
  background: rgba(255,255,255,0.05);
}

[data-theme="dark"] .google-btn {
  background: rgba(255,255,255,0.05);
}

/* ─── Legacy split-layout compat ───
   TODO: Remove these two rules once all auth pages are migrated to the
   new single-card HTML structure (no .auth-hero / .auth-form-panel). */
.auth-hero {
  display: none;
}

.auth-form-panel {
  display: contents;
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
  .auth-page {
    padding: var(--space-4) var(--space-4) var(--space-3);
  }

  .auth-card {
    max-width: 100%;
  }

  .auth-title {
    font-size: var(--font-size-xl);
  }

  .auth-footer-inline,
  .auth-footer {
    font-size: 9px;
    opacity: 0.6;
  }

  .auth-footer-inline a,
  .auth-footer a {
    min-height: auto;
    padding: 4px 2px;
  }
}

/* ─── Azure button gap ─── */
.google-btn + .google-btn { margin-top: 8px; }
