:root {
    color-scheme: light;
    --ink: #18333b;
    --teal: #143d4a;
    --muted: #5e7377;
    --coral: #e56b4f;
    --coral-dark: #c74e34;
    --line: #dde5e2;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; background: var(--teal); }
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    padding: 32px 20px;
    display: grid;
    place-items: center;
    background: linear-gradient(115deg, rgba(5, 25, 31, .64), rgba(12, 37, 43, .4)),
        url('../images/site/bg_image.png') center / cover no-repeat;
    background-attachment: fixed;
    color: var(--ink);
    font-family: 'Montserrat', Arial, sans-serif;
}
button, input { font: inherit; }
svg { display: block; flex-shrink: 0; }
a { color: var(--coral-dark); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible {
    outline: 3px solid #5daeb1;
    outline-offset: 4px;
}
.login-container {
    width: 100%;
    max-width: 460px;
    padding: 30px 36px 26px;
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 22px;
    background: #fffdf8;
    box-shadow: 0 24px 70px rgba(5, 25, 31, .28);
}
.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 0 22px;
    color: var(--teal);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.6;
    letter-spacing: 1.9px;
    text-transform: uppercase;
}
.brand::before, .brand::after { content: ''; width: 20px; height: 1px; background: #f0b39f; }
.login-header { margin-bottom: 28px; text-align: center; }
.status-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border: 1px solid #f3d8c9;
    border-radius: 20px;
    background: #fff0e7;
    color: var(--coral-dark);
}
h1 {
    margin: 0 0 10px;
    color: var(--teal);
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(30px, 6vw, 36px);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -.6px;
}
.intro { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.logout-message {
    margin-bottom: 22px;
    padding: 12px 14px;
    border: 1px solid #c9dfd6;
    border-radius: 10px;
    background: #edf6f0;
    color: #2e6751;
    font-size: 12px;
    line-height: 1.6;
}
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 9px; font-size: 12px; font-weight: 600; }
.input-wrapper { position: relative; }
.form-control {
    display: block;
    width: 100%;
    min-height: 54px;
    padding: 15px 44px;
    border: 1px solid #cbd9d7;
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font-size: 16px;
    line-height: 22px;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}
.form-control::placeholder { color: #839699; opacity: 1; }
.form-control:focus { outline: none; border-color: #5b979c; box-shadow: 0 0 0 3px rgba(93, 174, 177, .16); }
.input-icon { position: absolute; left: 15px; top: 17px; width: 20px; height: 20px; color: #6a858a; pointer-events: none; }
.input-wrapper:focus-within .input-icon { color: var(--coral-dark); }
.toggle-password {
    position: absolute;
    top: 5px;
    right: 4px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #5d777c;
    cursor: pointer;
}
.toggle-password:hover { background: #fff0e7; color: var(--coral-dark); }
.toggle-password .eye-off { display: none; }
.toggle-password[aria-pressed="true"] .eye-on { display: none; }
.toggle-password[aria-pressed="true"] .eye-off { display: block; }
.login-options { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-top: 4px; }
.checkbox-wrapper { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; line-height: 1.6; cursor: pointer; }
.checkbox-wrapper input { width: 16px; height: 16px; margin: 0; accent-color: var(--coral-dark); }
.forgot-link { font-size: 12px; font-weight: 600; text-decoration: none; }
.forgot-link:hover, .signup-link a:hover { color: #ad3f28; text-decoration: underline; }
.btn-sign-in {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 50px;
    margin: 24px 0 18px;
    padding: 14px 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--coral);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 5px 14px rgba(229, 107, 79, .18);
    transition: background 160ms ease, box-shadow 160ms ease;
}
.btn-sign-in:hover { background: var(--coral-dark); box-shadow: 0 7px 18px rgba(229, 107, 79, .24); }
.btn-sign-in:disabled { opacity: .7; cursor: wait; }
.signup-link { margin: 0; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.8; }
.signup-link a { display: inline-block; margin-left: 4px; font-weight: 600; text-decoration: none; }
.card-footer { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; }
.btn-back-home { display: inline-flex; align-items: center; gap: 8px; padding: 4px; color: var(--muted); font-size: 12px; font-weight: 500; text-decoration: none; }
.btn-back-home:hover { color: var(--teal); }
.loading-spinner { display: none; margin-top: 20px; text-align: center; color: var(--muted); font-size: 12px; }
.loading-spinner.active { display: block; }
.loading-spinner p { margin: 8px 0 0; }
.spinner-border { width: 24px; height: 24px; margin: auto; border: 2px solid #f3d8c9; border-top-color: var(--coral-dark); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.swal2-popup { background: #fffdf8 !important; color: var(--ink) !important; border: 1px solid var(--line); border-radius: 18px !important; }
.swal2-title { color: var(--teal) !important; font-family: 'Playfair Display', Georgia, serif !important; }
.swal2-html-container { color: var(--muted) !important; }
.swal2-confirm { background: var(--coral-dark) !important; }
.swal2-cancel { background: #5e7377 !important; }
@media (max-width: 480px) {
    body { padding: 20px 14px; background-attachment: scroll; }
    .login-container { padding: 28px 24px 24px; border-radius: 18px; }
    .brand { gap: 8px; font-size: 9px; letter-spacing: 1.6px; }
    .brand::before, .brand::after { width: 15px; }
    .form-control { padding-left: 42px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation-duration: 2s !important; }
}
