/* ============================================================
   PROLERUS ME — SIGN IN
   Midnight Blue + Teal Design System
   ============================================================ */

:root {
    --bg:           #080c18;
    --surface:      #0e1935;
    --elevated:     #141f48;
    --card-bg:      rgba(18, 30, 64, 0.94);
    --border:       rgba(148, 163, 184, 0.50);
    --border-hover: rgba(148, 163, 184, 0.75);
    --border-accent:rgba(20, 184, 166, 0.65);
    --accent:       #14b8a6;
    --accent-hover: #0f9e8d;
    --accent-bright:#2dd4bf;
    --accent-dim:   rgba(20, 184, 166, 0.10);
    --accent-glow:  0 0 28px rgba(20, 184, 166, 0.22);
    --text-primary: #e2e8f0;
    --text-secondary:#b8c8dc;
    --text-muted:   #8a9ab4;
    --error:        #f43f5e;
    --error-dim:    rgba(244, 63, 94, 0.12);
    --radius-sm:    8px;
    --radius-md:    12px;
    --radius-lg:    16px;
    --radius-xl:    24px;
}

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

body {
    font-family: "Fustat", "Montserrat", sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse at 15% 60%, rgba(20, 184, 166, 0.05) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 20%, rgba(56, 189, 248, 0.04) 0%, transparent 50%),
        linear-gradient(160deg, #060a14 0%, #0d1525 50%, #080c18 100%);
    background-attachment: fixed;
    color: var(--text-primary);
}

/* ── Header ─────────────────────────────────────────────── */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 40px;
    background: rgba(8, 12, 24, 0.6);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h2 {
    font-family: "Unbounded", sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}

header h2 a,
header a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

header h2 a:hover {
    color: var(--accent-bright);
}

header h5 {
    margin: 0;
    font-weight: 400;
    font-size: 0.875rem;
}

.discover-more {
    display: inline-block;
    padding: 7px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-accent);
    color: var(--accent-bright);
    font-family: "Fustat", sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.2px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.discover-more:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
    box-shadow: 0 0 16px rgba(20, 184, 166, 0.18);
    transform: translateY(-1px);
}

/* ── Main ────────────────────────────────────────────────── */
main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

/* ── Card ────────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow:
        0 4px 40px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 0 80px rgba(20, 184, 166, 0.04);
    padding: 44px 40px 36px;
    width: 90%;
    max-width: 420px;
    margin: 0 auto;
    animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.card a {
    color: inherit;
    text-decoration: none;
    font-family: "Fustat", sans-serif;
}

.card h2 {
    font-family: "Unbounded", sans-serif;
    font-weight: 600;
    font-size: 1.75rem;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    margin-bottom: 6px;
    text-align: center;
}

.tagline {
    font-family: "Fustat", sans-serif;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 28px;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Inputs ──────────────────────────────────────────────── */
.input-container {
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.input-container .field-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    color: var(--text-muted);
    transition: color 0.2s ease;
    pointer-events: none;
}

.input-container:focus-within .field-icon {
    color: var(--accent);
}

form input {
    width: 100%;
    height: 52px;
    padding: 20px 16px 6px 44px;
    background: rgba(8, 12, 24, 0.7);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-family: "Fustat", sans-serif;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

form input:focus {
    outline: none;
    border-color: var(--border-accent);
    background: rgba(8, 12, 24, 0.9);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

/* Floating labels */
.input-container label {
    position: absolute;
    left: 44px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    font-family: "Fustat", sans-serif;
    color: var(--text-muted);
    pointer-events: none;
    transition: all 0.2s ease;
}

form input:focus + label,
form input:not(:placeholder-shown) + label,
form input:-webkit-autofill + label {
    top: 10px;
    transform: none;
    font-size: 0.6rem;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

/* Password show/hide toggle */
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.2s ease;
}

.toggle-password:hover {
    color: var(--accent-bright);
}

.toggle-password i {
    font-size: 14px;
}

/* ── Error ───────────────────────────────────────────────── */
#errorMessage {
    display: none;
    background: var(--error-dim);
    border: 1px solid rgba(244, 63, 94, 0.25);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: #fda4af;
    font-size: 0.875rem;
    text-align: center;
    margin-bottom: 14px;
}

.error-message {
    color: #fda4af;
    font-size: 0.875rem;
    margin: 8px 0;
    min-height: 20px;
    text-align: center;
}

/* ── Buttons ─────────────────────────────────────────────── */
.submit {
    width: 100%;
    padding: 13px 24px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border: none;
    border-radius: var(--radius-sm);
    color: #042a25;
    font-family: "Fustat", sans-serif;
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
    box-shadow: 0 0 20px rgba(20, 184, 166, 0.2), 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 0 32px rgba(20, 184, 166, 0.35), 0 6px 16px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 100%);
}

.submit:active {
    transform: translateY(0);
}

.submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.submit:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.reg {
    width: 100%;
    padding: 12px 24px;
    background: transparent;
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-sm);
    color: var(--accent-bright);
    font-family: "Fustat", sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 12px;
}

.reg:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
    box-shadow: 0 0 16px rgba(20, 184, 166, 0.12);
}

.reg:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* ── Links ───────────────────────────────────────────────── */
.forgot-password {
    display: block;
    margin-top: 14px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
    text-align: right;
}

.forgot-password:hover {
    color: var(--accent-bright);
}

.switch-version {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.switch-version a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color 0.2s ease;
}

.switch-version a:hover {
    color: var(--text-secondary);
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
    text-align: center;
    font-family: "Fustat", sans-serif;
    padding: 24px 20px;
    font-size: 0.8125rem;
    display: flex;
    justify-content: center;
    gap: 40px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--text-secondary);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
    header {
        padding: 16px 24px;
    }

    .card {
        padding: 36px 28px 28px;
    }

    .card h2 {
        font-size: 1.5rem;
    }

    footer {
        gap: 20px;
    }
}

@media (max-width: 380px) {
    .card {
        padding: 28px 20px 24px;
        border-radius: var(--radius-lg);
    }

    header h5 {
        display: none;
    }
}

/* ── Loading spinner ─────────────────────────────────────── */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.fa-spinner { animation: spin 0.8s linear infinite; }
