/* static/auth.css
   Standalone styling for the logged-out pages (/auth/login, /auth/register).

   Deliberately self-contained and light-only: these pages do not extend
   base.html and do not read the app's dark/light theme variables, so the
   theme toggle in the user menu cannot reach them. */

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

body {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    background: #f3f4f6;
    color: #0f172a;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Logo, pinned to the top-left of the page. Never themed. */
.auth-logo {
    position: fixed;
    top: 20px;
    left: 20px;
    display: block;
    z-index: 10;
}

.auth-logo img {
    display: block;
    height: 40px;
    width: auto;
}

/* Centres the card in the viewport. */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px 40px;
}

.auth-card {
    background: #ffffff;
    width: 100%;
    max-width: 400px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 36px 32px 32px;
    box-shadow:
        0 10px 30px rgba(15, 23, 42, 0.06),
        0 1px 2px rgba(15, 23, 42, 0.04);
}

.auth-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
}

.auth-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 24px;
}

/* Flash messages, so a failed login is never silent. */
.alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.8125rem;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.alert-error   { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #b45309; }

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.input-wrap {
    position: relative;
}

.input-wrap input {
    width: 100%;
    padding: 11px 44px 11px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    font-family: inherit;
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-wrap input::placeholder {
    color: #9ca3af;
}

.input-wrap input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Password visibility toggle, sat inside the right edge of the input. */
.pw-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: none;
    background: none;
    color: #64748b;
    cursor: pointer;
    border-radius: 6px;
    line-height: 0;
}

.pw-toggle:hover {
    color: #0f172a;
}

.pw-toggle:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

.pw-toggle svg {
    width: 18px;
    height: 18px;
}

.pw-toggle .icon-hide { display: none; }
.pw-toggle.is-visible .icon-show { display: none; }
.pw-toggle.is-visible .icon-hide { display: block; }

/* "Forgot password?" — small text link, left-aligned under the password box. */
.forgot-row {
    display: flex;
    justify-content: flex-start;
    margin-top: 8px;
}

.forgot-row a {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6366f1;
    text-decoration: none;
}

.forgot-row a:hover {
    text-decoration: underline;
}

.btn-primary {
    width: 100%;
    padding: 11px 16px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.btn-primary:hover  { opacity: 0.92; }
.btn-primary:active { transform: translateY(1px); }

.remember-login {
    display: flex;
    align-items: center;
    gap: 8px;
}

.remember-login label {
    margin: 0;
}

#firebase-auth {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

#firebase-auth .btn-secondary {
    padding: 11px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font: inherit;
    cursor: pointer;
}

#firebase-auth .btn-secondary:hover {
    background: #f8fafc;
}

#firebase-auth .btn-secondary:disabled {
    opacity: 0.6;
    cursor: wait;
}

#firebase-message {
    font-size: 0.875rem;
    color: #475569;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.875rem;
    color: #64748b;
}

.auth-footer a {
    color: #6366f1;
    font-weight: 600;
    text-decoration: none;
}

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

@media (max-width: 480px) {
    .auth-logo { top: 20px; left: 20px; }
    .auth-card { padding: 28px 22px 24px; }
}



.sso-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.sso-button svg {
  flex-shrink: 0;
}