/* =Variables -------------------------------------------------------------- */
:root {
    /* Palette inspired by the uploaded logo (teal/blue) */
    --bg: #0b1020;
    --card: #0f172a;
    --card-solid: #0f172a;
    /* used in SVG fills */
    --card-border: #1e2a3d;
    --muted: #9bb3bc;
    --text: #e6f1f3;
    --accent: #47848f;
    /* teal from logo */
    --accent-2: #73bcc3;
    /* lighter teal */
    --danger: #ef4444;
}

/* =Base ------------------------------------------------------------------ */
html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    width: 100%;
    color: #0f172a;
    background: #ffffff;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

/* Only prevent overflow on login page */
body:has(.is-login) {
    height: 100%;
    overflow: hidden;
}

.dark body {
    color: var(--text);
    background: radial-gradient(1200px 800px at 10% 10%, #0a1420 0%, #081018 60%, #060a11 100%);
}

/* =Layout ---------------------------------------------------------------- */
.app-container {
    display: flex;
    height: 100svh;
    min-height: 100svh;
    position: relative;
    width: 100%;
    max-width: 100%;
}

.app-container.is-login {
    overflow: hidden;
}

/* Left (hero) and right (content) split 50/50 */
.left {
    position: relative;
    flex: 0 0 50%;
    min-width: 50%;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    overflow: hidden;
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

.left:before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(5, 8, 15, .18), rgba(5, 8, 15, .35));
}

.right {
    flex: 0 0 50%;
    min-width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.theme-light .app-container,
.theme-light .right {
    background: #f8fafc;
}

.theme-light #dashCard {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .06);
}

/* Light theme refinements */
.theme-light {
    background: white;
}

.theme-light .left {
    display: none;
}

.theme-light .right {
    background: white;
    flex: 1 1 100%;
    min-width: 100%;
    justify-content: center;
}

.card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #0f172a;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .08);
    animation: fadeUp .6s ease-out both;
    overflow: hidden; /* prevent inner controls from visually overflowing rounded corners */
}

.dark .card {
    background: linear-gradient(180deg, rgba(17, 24, 39, .7), rgba(17, 24, 39, .45));
    border: 1px solid var(--card-border);
    color: var(--text);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.brand-logo {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: contain;
}

.title {
    font-size: 22px;
    font-weight: 800;
    margin: 6px 0 16px;
    text-align: center;
    letter-spacing: .2px;
}

.subtitle {
    font-size: 13px;
    color: #4b5563;
    text-align: center;
    margin-bottom: 18px;
}

.dark .subtitle {
    color: var(--muted);
}

.field {
    margin-bottom: 14px;
}

label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: #cbd5e1;
}

.control {
    position: relative;
    width: 100%;
}

.toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    outline: none;
}

.toggle-pw:hover {
    opacity: .7;
}

.toggle-pw .eye {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.dark .toggle-pw .eye {
    color: var(--accent-2);
}

.toggle-pw .eye-closed {
    display: none;
}

.toggle-pw.open .eye-open {
    display: none;
}

.toggle-pw.open .eye-closed {
    display: block;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px 44px 12px 12px;
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
    -webkit-text-fill-color: #0f172a !important;
    box-sizing: border-box; /* ensure padding doesn't cause overflow */
}

input[type="text"]:-webkit-autofill,
input[type="password"]:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    -webkit-text-fill-color: #0f172a !important;
    transition: background-color 5000s ease-in-out 0s;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: #9bb3bc;
    box-shadow: 0 0 0 3px rgba(76, 138, 146, .15);
    background: #ffffff;
}

.dark input[type="text"],
.dark input[type="password"] {
    background: rgba(17, 24, 39, .65) !important;
    color: var(--text) !important;
    border: 1px solid #253045;
    -webkit-text-fill-color: var(--text) !important;
}

.dark input[type="text"]:-webkit-autofill,
.dark input[type="password"]:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px rgba(17, 24, 39, .65) inset !important;
    -webkit-text-fill-color: var(--text) !important;
}

.dark input[type="text"]:focus,
.dark input[type="password"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .25);
    background: rgba(17, 24, 39, .85);
}

.toggle-pass {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    outline: none;
    background: transparent;
    cursor: pointer;
    color: #9aa4b2;
    padding: 6px;
    border-radius: 9999px;
    transition: background .2s, color .2s, transform .12s;
}

.toggle-pass:hover {
    color: #cbd5e1;
    background: rgba(148, 163, 184, .12);
}

.toggle-pass:active {
    transform: translateY(-50%) scale(0.98);
}

.toggle-pass svg {
    display: block;
    width: 20px;
    height: 20px;
}

.toggle-pass .slash {
    opacity: 1;
    transition: opacity .2s ease;
}

.toggle-pass.open .slash {
    opacity: 0;
}

.actions {
    margin-top: 16px;
}

.btn {
    width: 100%;
    padding: 12px 14px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .08);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, .10);
    filter: saturate(1.02);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(0, 0, 0, .08);
}

.btn .spinner {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .9s linear infinite;
    display: none;
}

.btn.loading .spinner {
    display: block;
}

.btn.loading .txt {
    visibility: hidden;
}

.error {
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 12px;
    animation: shake .35s ease-out;
}

.dark .error {
    color: #fecaca;
    background: rgba(239, 68, 68, .08);
    border: 1px solid rgba(239, 68, 68, .25);
}

.helper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    color: #a3a9b6;
    font-size: 12px;
}

.link {
    color: #c7d2fe;
    text-decoration: none;
}

.link:hover {
    text-decoration: underline;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: translate(-50%, -50%) rotate(0);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes shake {
    0% {
        transform: translateX(0)
    }

    25% {
        transform: translateX(-4px)
    }

    50% {
        transform: translateX(4px)
    }

    75% {
        transform: translateX(-2px)
    }

    100% {
        transform: translateX(0)
    }
}

@media (max-width: 900px) {
    .is-login {
        display: flex;
        flex-direction: column;
        height: 100svh;
    }

    .is-login .left {
        flex: 0 0 50%;
        min-height: 50%;
        height: 50%;
    }

    .is-login .right {
        flex: 0 0 50%;
        min-height: 50%;
        height: 50%;
        position: relative;
        padding: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .card,
    .btn,
    .error {
        animation: none;
        transition: none;
    }
}