/* Login Page Stylesheet */
:root {
    --radius: 16px;
    --space: 16px;
    --stroke: rgba(14, 26, 51, 0.2);
    --text: #0e1a33;
    --muted: #1d68e5;
    --primary: #1d68e5;
    --primary-600: #1259c7;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--text);
    background: #f4f8ff;
}

.wrap {
    min-height: 100vh;
    width: 100%;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #0e1a33 0%, #1d68e5 100%);
}

.card {
    width: min(450px, 92vw);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    box-shadow: 0 20px 40px rgba(14, 26, 51, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    padding: 32px 28px;
}

.header {
    text-align: center;
    margin-bottom: 32px;
}

.brand {
    height: 60px;
    margin-bottom: 16px;
}

.brand img {
    height: 100%;
    width: auto;
}

h1 {
    font-size: 30px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #0e1a33;
}

.subtitle {
    color: var(--muted);
    font-size: 16px;
    margin: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 14px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 16px;
}

.form-input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    border: 1px solid var(--stroke);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--text);
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-input::placeholder {
    color: var(--muted);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(43, 138, 109, 0.1);
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 16px;
    transition: color 0.3s ease;
    margin-right: 8%;
}

.password-toggle:hover {
    color: var(--primary);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.remember-me {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--muted);
}

.remember-me input {
    margin-right: 8px;
    accent-color: var(--primary);
}

.forgot-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: var(--primary-600);
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-600) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(43, 138, 109, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    display: none;
}

.message.success {
    background: rgba(34, 197, 94, 0.1);
    color: #0f8a3c;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.mc-link {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
    padding: 12px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--stroke);
    transition: all 0.3s ease;
    z-index: 10;
}

.mc-link:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(14, 26, 51, 0.1);
}

.admin-links {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--stroke);
}

.admin-links a {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.admin-links a:hover {
    color: var(--primary-600);
}

.link-separator {
    margin: 0 12px;
    color: var(--muted);
}

.footer-credit {
    text-align: center;
    margin-top: 24px;
    font-size: 12px;
    color: var(--muted);
}

.footer-credit a {
    text-decoration: none;
    color: inherit;
    /* Inherits the muted color from the parent */
    transition: color 0.3s ease;
}

.footer-credit a:hover .company-name {
    color: var(--primary-600);
    /* Darken company name on hover */
}

.footer-credit .company-name {
    font-weight: 600;
    color: var(--primary);
    /* Use the theme's primary color */
    transition: color 0.3s ease;
}

/* Responsive Design */
@media (max-width: 900px) {
    .wrap {
        padding: 16px 16px 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-end;
        gap: 12px;
        box-sizing: border-box;
        min-height: 100vh;
        /* Fallback */
        min-height: -webkit-fill-available;
        height: 100%;
    }

    .card {
        padding: 16px;
        position: static;
        width: 100%;
        box-sizing: border-box;
        flex-shrink: 0;
    }

    .header {
        margin-bottom: 16px;
    }

    .brand {
        height: 40px;
        margin-bottom: 8px;
    }

    h1 {
        font-size: 22px;
        margin-bottom: 4px;
    }

    .subtitle {
        font-size: 14px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .form-input {
        padding: 12px 12px 12px 40px;
        font-size: 14px;
    }

    .input-wrapper i {
        left: 12px;
    }

    .login-btn {
        padding: 12px;
        margin-bottom: 12px;
    }

    .admin-links {
        margin-top: 16px;
        padding-top: 16px;
    }

    .mc-link {
        position: static;
        width: auto;
        text-align: center;
        flex-shrink: 0;
        padding: 8px 16px;
    }

    .footer-credit {
        margin-top: 16px;
    }
}

/* === Back Button (Unified with Verify Page) === */
.back-button {
    position: absolute;
    left: 1rem;
    top: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, transform 0.08s ease;
    backdrop-filter: blur(4px);
    z-index: 60;
    font-weight: 400;
    font-size: 1rem;
}

.back-button:hover {
    background: rgba(29, 104, 229, 0.12);
    border-color: rgba(29, 104, 229, 0.6);
    transform: translateY(-1px);
}

.back-button .material-symbols-outlined {
    font-size: 1.25rem;
}

.back-button .back-text {
    display: inline-block;
}

@media (max-width: 420px) {
    .back-button {
        left: 0.75rem;
        top: 0.85rem;
        padding: 0.4rem 0.5rem;
    }

    .back-button .back-text {
        display: none;
    }
}

/* ===== Dark Mode Support ===== */
body.dark-mode .card {
    background: rgba(40, 44, 49, 0.95);
    border-color: #444950;
}

body.dark-mode .card h1,
body.dark-mode .card label {
    color: #e6e6e6;
}

body.dark-mode .card .subtitle {
    color: #b0bec5;
}

body.dark-mode .card .form-input {
    background: #333840 !important;
    border-color: #444950 !important;
    color: #e6e6e6 !important;
}

body.dark-mode .card .form-input::placeholder {
    color: #888;
}

body.dark-mode .card .input-wrapper i {
    color: #888;
}

body.dark-mode .card a {
    color: #3b86ff;
}

body.dark-mode .card a:hover {
    color: #b8d4ab;
}

body.dark-mode .brand img {
    filter: brightness(0) invert(1);
}