/* ════════════════════════════════════════════════════════════════
   Sign-in page
   ════════════════════════════════════════════════════════════════ */

/* ── Reset / base ───────────────────────────────────────────────── */
html, body {
    height: 100%;
    margin: 0;
    font-family: var(--bs-font-sans-serif);
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: var(--bs-body-bg);
    transition: background-color .3s ease;
}

/* ── Background blobs ────────────────────────────────────────────── */
.signin-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .35;
    pointer-events: none;
    z-index: 0;
    transition: opacity .3s;
}

.signin-blob--1 {
    width: 520px;
    height: 520px;
    top: -120px;
    left: -140px;
    background: radial-gradient(circle, #6366f1 0%, #8b5cf6 60%, transparent 100%);
}

.signin-blob--2 {
    width: 420px;
    height: 420px;
    bottom: -100px;
    right: -100px;
    background: radial-gradient(circle, #3b82f6 0%, #06b6d4 60%, transparent 100%);
}

[data-bs-theme="light"] .signin-blob {
    opacity: .18;
}

/* ── Theme toggle button ─────────────────────────────────────────── */
.signin-theme-btn {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 100;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    transition: background .25s, color .25s, border-color .25s, transform .15s, box-shadow .2s;
}

.signin-theme-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 4px 16px rgba(99, 102, 241, .35);
    border-color: #6366f1;
    color: #6366f1;
}

/* ── Centering wrapper ───────────────────────────────────────────── */
.signin-wrap {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 1.5rem;
    display: flex;
    justify-content: center;
}

/* ── Card ────────────────────────────────────────────────────────── */
.signin-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem 2.5rem 2rem;
    border-radius: 1.25rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    box-shadow:
        0 4px 6px -1px rgba(0,0,0,.1),
        0 20px 60px -8px rgba(0,0,0,.25);
    backdrop-filter: blur(12px);
    transition: background .3s, border-color .3s;
}

[data-bs-theme="light"] .signin-card {
    box-shadow:
        0 4px 6px -1px rgba(0,0,0,.06),
        0 16px 48px -8px rgba(0,0,0,.12);
}

/* ── Brand / logo ─────────────────────────────────────────────────── */
.signin-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: 1.75rem;
}

.signin-logo {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: .6rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, .45);
}

.signin-brand-name {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -.5px;
    color: var(--bs-body-color);
}

/* ── Headings ─────────────────────────────────────────────────────── */
.signin-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 .25rem;
    color: var(--bs-body-color);
    letter-spacing: -.4px;
}

.signin-subtitle {
    font-size: .875rem;
    color: var(--bs-secondary-color);
    margin-bottom: 1.75rem;
}

/* ── Form field ───────────────────────────────────────────────────── */
.signin-field {
    margin-bottom: 1.1rem;
}

.signin-label {
    display: block;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    margin-bottom: .4rem;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.signin-input {
    width: 100%;
    height: 2.75rem;
    padding: .5rem .875rem;
    font-size: .9375rem;
    border-radius: .6rem;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    transition: border-color .2s, box-shadow .2s, background .3s;
    outline: none;
}

.signin-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .2);
    background: var(--bs-body-bg);
}

.signin-input::placeholder {
    color: var(--bs-tertiary-color);
}

/* Password wrapper */
.signin-input-wrap {
    position: relative;
}

.signin-input-wrap .signin-input {
    padding-right: 2.75rem;
}

.signin-eye {
    position: absolute;
    right: .6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: .2rem .3rem;
    color: var(--bs-secondary-color);
    cursor: pointer;
    line-height: 1;
    font-size: 1rem;
    transition: color .15s;
}

.signin-eye:hover {
    color: #6366f1;
}

/* Validation error */
.signin-error {
    display: block;
    margin-top: .3rem;
    font-size: .8rem;
    color: var(--bs-danger);
}

/* ── Remember me ──────────────────────────────────────────────────── */
.signin-remember {
    margin-bottom: 1.25rem;
    font-size: .875rem;
}

.signin-remember .form-check-input:checked {
    background-color: #6366f1;
    border-color: #6366f1;
}

/* ── Success banner ───────────────────────────────────────────────── */
.signin-success {
    margin-bottom: 1rem;
    padding: .65rem .9rem;
    border-radius: .6rem;
    background: rgba(34, 197, 94, .10);
    border: 1px solid rgba(34, 197, 94, .28);
    color: #4ade80;
    font-size: .875rem;
}

[data-bs-theme="light"] .signin-success {
    background: rgba(22, 163, 74, .08);
    border-color: rgba(22, 163, 74, .25);
    color: #15803d;
}

/* ── Server-side alert ────────────────────────────────────────────── */
.signin-alert:not(:empty) {
    margin-bottom: 1rem;
    padding: .65rem .9rem;
    border-radius: .6rem;
    background: rgba(220, 53, 69, .12);
    border: 1px solid rgba(220, 53, 69, .3);
    color: var(--bs-danger);
    font-size: .875rem;
}

/* ── Submit button ────────────────────────────────────────────────── */
.signin-btn {
    height: 2.75rem;
    font-size: .9375rem;
    font-weight: 600;
    border-radius: .6rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    color: #fff;
    letter-spacing: .01em;
    transition: opacity .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 4px 14px rgba(99, 102, 241, .4);
    margin-top: .25rem;
}

.signin-btn:hover {
    opacity: .92;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, .5);
    color: #fff;
}

.signin-btn:active {
    transform: translateY(0);
    opacity: 1;
}

/* ── Footer ───────────────────────────────────────────────────────── */
.signin-footer {
    margin-top: 1.75rem;
    margin-bottom: 0;
    text-align: center;
    font-size: .8rem;
    color: var(--bs-tertiary-color);
}

/* ── Dark theme ───────────────────────────────────────────────────── */
/* Card shadow is already strong by default (dark mode baseline).
   In light mode it's reduced — see [data-bs-theme="light"] above.
   Extra tweaks for better contrast in dark mode: */
[data-bs-theme="dark"] .signin-card {
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, .3),
        0 20px 60px -8px rgba(0, 0, 0, .6);
    border-color: rgba(255, 255, 255, .08);
}
[data-bs-theme="dark"] .signin-input {
    background: var(--bs-secondary-bg);
}
[data-bs-theme="dark"] .signin-input:focus {
    background: var(--bs-secondary-bg);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .3);
}
[data-bs-theme="dark"] .signin-theme-btn {
    box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}

/* ── Forgot-password link (below form) ────────────────────────────── */
.signin-link {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
    transition: color .15s, text-decoration-color .15s;
    text-decoration-color: transparent;
}

.signin-link:hover {
    color: #818cf8;
    text-decoration: underline;
    text-decoration-color: #818cf8;
}

/* ── Info / hint text ─────────────────────────────────────────────── */
.signin-hint {
    font-size: .825rem;
    color: var(--bs-secondary-color);
    line-height: 1.5;
    text-align: center;
}

/* ── Sent / success state ─────────────────────────────────────────── */
.signin-sent-wrap {
    text-align: center;
}

.signin-sent-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99,102,241,.15), rgba(139,92,246,.15));
    border: 1px solid rgba(99,102,241,.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #818cf8;
    margin: 0 auto 1.25rem;
}

.signin-sent-icon--danger {
    background: linear-gradient(135deg, rgba(239,68,68,.1), rgba(220,38,38,.1));
    border-color: rgba(239,68,68,.3);
    color: #f87171;
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .signin-card {
        padding: 2rem 1.5rem 1.5rem;
        border-radius: 1rem;
    }

    .signin-blob--1 { width: 300px; height: 300px; }
    .signin-blob--2 { width: 260px; height: 260px; }
}
