/* ==============================
   1. Global variables
============================== */

:root {
    --navy: #08162c;
    --blue: #4cc7f4;
    --yellow: #f5cc43;
    --white: #f8fbff;
    --muted: #bdc9db;

    --glass: rgba(8, 22, 44, 0.48);
    --border: rgba(255, 255, 255, 0.18);

    --radius: 18px;
    --spacing: 24px;
    --container-width: 1400px;
    --shadow: 0 16px 50px rgba(0, 0, 0, 0.2);
}


/* ==============================
   2. Global layout
============================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;

    display: flex;
    flex-direction: column;
    isolation: isolate;

    background: var(--navy);
    color: var(--white);

    font-family: Arial, Helvetica, sans-serif;
}

button,
input,
textarea,
select {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 4px;
}


/* ==============================
   3. Animated background
============================== */

.background-slides {
    position: fixed;
    inset: 0;
    z-index: -1;

    overflow: hidden;
    pointer-events: none;
    background: var(--navy);
}

.background-slide {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;
    opacity: 0;
    transform: scale(1);

    transition:
        opacity 1.5s ease-in-out,
        transform 8s ease;
}

.background-slide.is-active {
    opacity: 1;
    transform: scale(1.15);
}

.background-overlay {
    position: absolute;
    inset: 0;

    background: linear-gradient(
        135deg,
        rgba(8, 22, 44, 0.65),
        rgba(8, 22, 44, 0.30)
    );
}


/* ==============================
   4. Reusable glass effect
============================== */

.glass {
    background: var(--glass);
    border: 1px solid var(--border);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    box-shadow: var(--shadow);
}


/* ==============================
   5. Navbar
============================== */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;

    margin: 16px var(--spacing) 0;
    padding: 16px 24px;
    border-radius: var(--radius);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    border: 1px solid var(--blue);
    border-radius: 50%;

    font-size: 26px;
    font-weight: 800;
}

.brand-mark span {
    color: var(--blue);
}

.brand-name {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 3px;
}

.brand-name small {
    display: block;
    margin-top: 4px;

    font-size: 9px;
    font-weight: 400;
    letter-spacing: 2px;
    color: var(--muted);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a:not(.button) {
    color: var(--muted);
    transition: color 0.2s ease;
}

.nav-links a:not(.button):hover,
.nav-links a.active {
    color: var(--blue);
}


/* ==============================
   6. Main content layout
============================== */

.main-container {
    flex: 1;

    display: flex;
    flex-direction: column;

    width: 100%;
    max-width: var(--container-width);

    margin: 0 auto;
    padding: 40px var(--spacing);
}

.page-heading {
    margin-bottom: 24px;
}

.page-heading h1 {
    margin: 12px 0;
    font-size: clamp(28px, 4vw, 46px);
}

.page-heading h1 span {
    color: var(--blue);
}

.page-heading p {
    color: var(--muted);
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing);
}

.login-layout {
    flex: 1;

    display: grid;
    place-items: center;

    width: 100%;
}


/* ==============================
   7. Reusable cards
============================== */

.card {
    min-width: 0;
    padding: clamp(20px, 3vw, 32px);
    border-radius: var(--radius);

    animation: card-enter 0.6s ease both;
}

.login-card {
    width: 100%;
    max-width: 420px;
}

.card-heading {
    margin-bottom: 26px;
}

.card-heading h2 {
    margin: 10px 0;
    font-size: 24px;
}

.card-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.eyebrow {
    color: var(--yellow);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 3px;
}

.card-footer {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-top: 20px;
    padding-top: 16px;

    border-top: 1px solid var(--border);

    font-size: 12px;
    color: var(--muted);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #73d7ac;
}


/* ==============================
   8. Reusable forms
============================== */

.form {
    display: grid;
    gap: 18px;
}

.form-field {
    display: grid;
    gap: 8px;
}

.form-field label {
    font-size: 13px;
    font-weight: 600;
}

.form-control {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;

    color: var(--white);
    background: rgba(5, 18, 38, 0.35);

    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;

    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control::placeholder {
    color: rgba(220, 232, 245, 0.55);
}

.form-control:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(76, 199, 244, 0.12);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.password-control {
    position: relative;
}

.password-control .form-control {
    padding-inline-end: 70px;
}

.password-toggle {
    position: absolute;
    inset-inline-end: 12px;
    top: 50%;

    transform: translateY(-50%);

    border: none;
    background: transparent;
    color: var(--blue);

    font-size: 12px;
    font-weight: 700;
}

.form-message {
    min-height: 18px;
    margin: 0;

    font-size: 13px;
    color: var(--blue);
    line-height: 1.5;
}

.form-message.error {
    color: #ffabab;
}

.form-message.success {
    color: #73d7ac;
}


/* ==============================
   9. Reusable buttons
============================== */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    min-height: 48px;
    padding: 12px 20px;

    border: none;
    border-radius: 10px;

    background: linear-gradient(
        110deg,
        var(--blue),
        var(--yellow)
    );

    color: var(--navy);
    font-size: 14px;
    font-weight: 700;

    transition: transform 0.2s, filter 0.2s;
}

.button:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.button-small {
    min-height: 36px;
    padding: 8px 18px;
}

.button-outline {
    padding: 8px 14px;

    border: 1px solid var(--border);
    border-radius: 8px;

    color: var(--muted);
    background: rgba(255, 255, 255, 0.05);

    font-size: 12px;
}

.button-outline:hover {
    color: var(--white);
    border-color: var(--blue);
}


/* ==============================
   10. Reusable chart container
============================== */

.chart-container {
    position: relative;

    width: 100%;
    height: clamp(240px, 35vw, 340px);

    border: 1px dashed var(--border);
    border-radius: 12px;

    background: rgba(5, 18, 38, 0.2);
}

.chart-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}


/* ==============================
   11. Footer
============================== */

.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;

    margin: 0 var(--spacing) 16px;
    padding: 16px 24px;

    border-radius: var(--radius);

    color: var(--muted);
    font-size: 12px;
}

.footer-slogan {
    color: var(--blue);
    font-size: 10px;
    letter-spacing: 3px;
}


/* ==============================
   12. Animations
============================== */

@keyframes card-enter {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

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


/* ==============================
   13. Responsive design
============================== */

@media (max-width: 768px) {

    :root {
        --spacing: 16px;
    }

    .navbar {
        padding: 14px;
    }

    .main-container {
        padding-block: 28px;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        gap: 14px;
    }

    .footer {
        justify-content: center;
        text-align: center;
    }

    .footer-slogan {
        display: none;
    }
}

@media (max-width: 420px) {

    .navbar {
        justify-content: center;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
    }

    .brand-name {
        font-size: 14px;
    }
}

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

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    .background-slide {
        transform: none !important;
    }
}

.brand-logo {
    height: 55px;
    width: auto;
    object-fit: contain;
    display: block;
}