/* assets/css/login.css */

/* ---------- Page layout for auth screens ---------- */

/* Use neutral background but keep global body/layout from main.css */
body.page-login,
body.page-recover,
body.page-account {
  background: var(--bg-main);
}

/* Center auth card inside <main> only on auth pages */
.page-login .site-main,
.page-recover .site-main,
.page-account .site-main {
  flex: 1 0 auto;            /* still lets footer sit at bottom */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;               /* override 80% width from main.css */
  max-width: 100%;
  margin: 40px auto;
  padding: 0 16px;
}

/* Slightly tighter on very small screens */
@media (max-width: 600px) {
  .page-login .site-main,
  .page-recover .site-main,
  .page-account .site-main {
    margin: 24px auto;
    padding: 0 12px;
  }
}

/* ---------- Auth card ---------- */

.auth-wrapper {
  width: 100%;
  max-width: 360px;
  padding: 24px 20px 28px;
  border-radius: 8px;
  background: var(--bg-surface);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}

.auth-wrapper h1 {
  text-align: center;
  margin: 0 0 16px;
}

/* ---------- Form ---------- */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
  margin-top: 4px;
  padding: 7px 9px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-main);
  color: var(--text-main);
  font-size: 0.95rem;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--accent-primary-border);
  box-shadow: 0 0 0 1px var(--accent-primary-soft);
}

/* Use global button styles, just tweak layout here */
.auth-form .button-primary,
.auth-form .button {
  width: 100%;
  margin-top: 8px;
}

/* ---------- Footer link under form ---------- */

.auth-footer {
  margin-top: 14px;
  font-size: 0.85rem;
  text-align: center;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--accent-secondary);
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* ---------- Debug verification link (local dev) ---------- */

.auth-debug-label {
  margin: 8px 0 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-debug-link {
  padding: 6px 8px;
  border-radius: 4px;
  background: var(--bg-surface-alt);
  border: 1px dashed var(--border-subtle);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.8rem;
  line-height: 1.4;
  word-break: break-all;  /* keeps long URL from overflowing */
  white-space: normal;
}

.auth-debug-link a {
  color: var(--accent-secondary);
  text-decoration: none;
}

.auth-debug-link a:hover {
  text-decoration: underline;
}

/* ---------- Account page tweaks ---------- */

.page-account .auth-wrapper {
  max-width: 420px;
}

.account-avatar-block {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.account-avatar img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-primary);
  background: #000;
}

.account-form .field-help {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Remove avatar checkbox aligned nicely */
.account-remove-avatar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.account-remove-avatar input[type="checkbox"] {
  margin: 0;
}

/* Back to Home button at bottom of form */
.account-back-home {
  text-align: center;
}

/* ---------- Social login (Google) ---------- */

.auth-social {
  display: flex;
  justify-content: center;      /* center the Google button */
  margin-bottom: 16px;
}

/* Make sure the rendered Google button doesn't stretch full width */
.auth-social .g_id_signin {
  display: inline-block;
}

/* ---------- Divider line with "or" ---------- */

.auth-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 6px 0 16px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
  opacity: 0.6;
}

.auth-divider span {
  white-space: nowrap;
}

/* ---------- Alerts (success/error) ---------- */

.alert {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

/* Green success with a quick "flash" animation */
.alert-success {
  background: rgba(25, 135, 84, 0.18);
  border: 1px solid #198754;
  color: #e2f6ea;
  animation: alert-success-flash 0.7s ease-out 0s 2 alternate;
}

/* Subtle red error style */
.alert-error {
  background: rgba(220, 53, 69, 0.15);
  border: 1px solid #dc3545;
  color: #f8d7da;
}

@keyframes alert-success-flash {
  0% {
    transform: scale(0.98);
    box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.7);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(25, 135, 84, 0);
  }
}
