/* ============================================================
   Auth pages — Login, Sign Up, Password Reset
   Dark-mode first. Light-mode via html[data-theme='light'].
   ============================================================ */

body.auth-page {
    font-family: var(--font-body, 'Manrope', sans-serif);
    margin: 0;
    padding: 0;
    background-color: var(--primary-bg, #0d1117);
    color: var(--text-primary, #c9d1d9);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Subtle radial glow behind the form */
body.auth-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 30% 15%, rgba(31, 111, 235, 0.07) 0%, transparent 70%),
        radial-gradient(ellipse 50% 40% at 70% 85%, rgba(31, 111, 235, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.auth-page-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 90px 20px 48px; /* top accounts for fixed nav */
    position: relative;
    z-index: 1;
}

.auth-wrapper {
    width: 100%;
    max-width: 420px;
}

/* ---- Card ---- */
.auth-card {
    background: var(--card-bg, #161b22);
    border: 1px solid var(--border-color-subtle, #30363d);
    border-radius: 14px;
    padding: 38px 40px;
    box-shadow:
        0 4px 40px rgba(0, 0, 0, 0.45),
        0 1px 8px rgba(0, 0, 0, 0.2);
}

.auth-card-header {
    margin-bottom: 28px;
}

.auth-card-title {
    font-family: var(--font-headings, 'Outfit', sans-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-headlines, #f0f6fc);
    margin: 0 0 6px;
    letter-spacing: -0.3px;
}

.auth-card-subtitle {
    font-size: 14px;
    color: var(--text-secondary, #8b949e);
    margin: 0;
    line-height: 1.5;
}

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

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #8b949e);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.input-wrapper {
    position: relative;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-color-subtle, #30363d);
    border-radius: 8px;
    box-sizing: border-box;
    background-color: rgba(13, 17, 23, 0.7);
    color: var(--text-primary, #c9d1d9);
    font-family: var(--font-body, 'Manrope', sans-serif);
    font-size: 15px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="text"]:focus {
    border-color: var(--accent-blue, #1f6feb);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.18);
    outline: none;
    background-color: var(--card-bg, #161b22);
}

.form-group input::placeholder {
    color: var(--text-secondary, #8b949e);
    opacity: 0.45;
}

/* When input is inside .input-wrapper, make room for toggle button */
.input-wrapper input {
    padding-right: 42px;
}

/* ---- Password toggle ---- */
.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary, #8b949e);
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s ease;
    line-height: 1;
}

.password-toggle:hover {
    color: var(--text-primary, #c9d1d9);
}

/* ---- Forgot password link (inline, below password input) ---- */
.forgot-password-link {
    display: block;
    text-align: right;
    margin-top: 7px;
    font-size: 13px;
    color: var(--accent-blue, #1f6feb);
    text-decoration: none;
}

.forgot-password-link:hover {
    color: var(--accent-blue-hover, #388bfd);
    text-decoration: underline;
}

/* ---- Buttons ---- */
.btn-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    color: #fff;
    background-color: var(--accent-blue, #1f6feb);
    cursor: pointer;
    font-size: 15px;
    font-family: var(--font-headings, 'Outfit', sans-serif);
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: background-color 0.15s ease, opacity 0.15s ease;
    box-sizing: border-box;
}

.btn-auth:hover:not(:disabled) {
    background-color: var(--accent-blue-hover, #388bfd);
}

.btn-auth:active:not(:disabled) {
    opacity: 0.88;
}

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

/* Secondary variant (e.g. reset-password send button) */
.btn-auth-secondary {
    background-color: transparent;
    border: 1px solid var(--accent-blue, #1f6feb);
    color: var(--accent-blue, #1f6feb);
}

.btn-auth-secondary:hover:not(:disabled) {
    background-color: rgba(31, 111, 235, 0.1);
}

/* Google button */
.btn-google-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 20px;
    border: 1px solid var(--border-color-subtle, #30363d);
    border-radius: 8px;
    color: var(--text-primary, #c9d1d9);
    background-color: transparent;
    cursor: pointer;
    font-size: 14px;
    font-family: var(--font-body, 'Manrope', sans-serif);
    font-weight: 500;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    box-sizing: border-box;
}

.btn-google-auth:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: var(--border-color-darker, #21262d);
}

.btn-google-auth:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-google-auth img {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ---- Divider ---- */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-secondary, #8b949e);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

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

/* ---- Alerts ---- */
.auth-alert {
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid transparent;
}

.auth-alert-error {
    background-color: rgba(220, 53, 69, 0.1);
    color: #ff7b87;
    border-color: rgba(220, 53, 69, 0.22);
}

.auth-alert-success {
    background-color: rgba(46, 160, 67, 0.1);
    color: #56d364;
    border-color: rgba(46, 160, 67, 0.22);
}

/* ---- Password reset inline panel ---- */
.password-reset-panel {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--border-color-subtle, #30363d);
}

.password-reset-panel-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #c9d1d9);
    margin: 0 0 16px;
}

/* ---- Footer links below card ---- */
.auth-footer {
    text-align: center;
    margin-top: 22px;
    font-size: 14px;
    color: var(--text-secondary, #8b949e);
}

.auth-footer p {
    margin: 6px 0;
}

.auth-footer a {
    color: var(--accent-blue, #1f6feb);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    color: var(--accent-blue-hover, #388bfd);
    text-decoration: underline;
}

/* ===========================
   LIGHT MODE OVERRIDES
   =========================== */

html[data-theme='light'] body.auth-page {
    background-color: #eef3fb;
}

html[data-theme='light'] body.auth-page::before {
    background:
        radial-gradient(ellipse 60% 50% at 30% 15%, rgba(29, 78, 216, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 50% 40% at 70% 85%, rgba(29, 78, 216, 0.04) 0%, transparent 70%);
}

html[data-theme='light'] .auth-card {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.07),
        0 1px 4px rgba(0, 0, 0, 0.04);
}

html[data-theme='light'] .auth-card-title {
    color: #0f172a;
}

html[data-theme='light'] .auth-card-subtitle {
    color: #5b6574;
}

html[data-theme='light'] .form-group label {
    color: #64748b;
}

html[data-theme='light'] .form-group input[type="email"],
html[data-theme='light'] .form-group input[type="password"],
html[data-theme='light'] .form-group input[type="text"] {
    background-color: #f8fafc;
    border-color: rgba(15, 23, 42, 0.14);
    color: #1f2937;
}

html[data-theme='light'] .form-group input:focus {
    background-color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

html[data-theme='light'] .form-group input::placeholder {
    color: #94a3b8;
    opacity: 1;
}

html[data-theme='light'] .password-toggle {
    color: #94a3b8;
}

html[data-theme='light'] .password-toggle:hover {
    color: #374151;
}

html[data-theme='light'] .btn-google-auth {
    border-color: rgba(15, 23, 42, 0.14);
    color: #1f2937;
}

html[data-theme='light'] .btn-google-auth:hover:not(:disabled) {
    background-color: #f8fafc;
    border-color: rgba(15, 23, 42, 0.24);
}

html[data-theme='light'] .auth-divider {
    color: #94a3b8;
}

html[data-theme='light'] .auth-divider::before,
html[data-theme='light'] .auth-divider::after {
    background: rgba(15, 23, 42, 0.1);
}

html[data-theme='light'] .auth-footer {
    color: #64748b;
}

html[data-theme='light'] .password-reset-panel {
    border-top-color: rgba(15, 23, 42, 0.1);
}

html[data-theme='light'] .password-reset-panel-title {
    color: #1f2937;
}

html[data-theme='light'] .auth-alert-error {
    background-color: rgba(220, 53, 69, 0.07);
    color: #b91c1c;
    border-color: rgba(220, 53, 69, 0.18);
}

html[data-theme='light'] .auth-alert-success {
    background-color: rgba(22, 163, 74, 0.07);
    color: #15803d;
    border-color: rgba(22, 163, 74, 0.18);
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 480px) {
    .auth-page-body {
        align-items: flex-start;
        padding: 80px 16px 32px;
    }

    .auth-card {
        padding: 28px 24px;
        border-radius: 12px;
    }

    .auth-card-title {
        font-size: 20px;
    }
}
