/* Google Font */
@import url("https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&display=swap");

:root {
    --nav: #397c89;
    --nav-hover: #2f6a75;

    --bg: #f6f8fa;
    --card: #ffffff;

    /* Text colors (no pure black) */
    --text: #2b2f33; /* main text */
    --muted: #6b7280; /* secondary text */
    --border: #e5e7eb;

    /* Focus ring helper */
    --ring: rgba(57, 124, 137, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Syne", system-ui, -apple-system, Segoe UI, Roboto, Helvetica,
        Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

/* NAV */
.nav {
    background: var(--nav);
    position: sticky; /* desktop stays sticky */
    top: 0;
    z-index: 10;
}

.nav .inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    justify-content: center;
}

.menu a {
    display: inline-block;
    color: #ffffff;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.2px;
    text-align: center;
}

.menu a:hover,
.menu a:focus-visible {
    background: var(--nav-hover);
    outline: none;
}

.menu a.active {
    background: var(--nav-hover);
}

/* Mobile nav: compact AND scrolls away (NOT sticky) */
@media (max-width: 720px) {
    .nav {
        position: static; /* IMPORTANT: prevents overlay */
        top: auto;
        z-index: auto;
    }

    .nav .inner {
        padding: 6px 10px;
        min-height: auto;
    }

    .menu {
        gap: 4px;
    }

    .menu a {
        padding: 6px 8px;
        border-radius: 8px;
        font-size: 12.5px;
        line-height: 1.1;
        letter-spacing: 0.1px;
        white-space: nowrap;
    }
}

/* CONTENT */
main {
    max-width: 1100px;
    margin: 28px auto 40px;
    padding: 0 16px;
}

.content {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
}

.content h1 {
    margin: 0 0 6px;
    font-size: 32px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--text);
}

.content h2 {
    margin: 18px 0 10px;
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
}

.content h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.content h4 {
    margin: 6px 0 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--muted);
}

.content p {
    margin: 0 0 14px;
    font-weight: 400;
    color: var(--text);
}

@media (max-width: 520px) {
    .content {
        padding: 18px;
    }

    .content h1 {
        font-size: 26px;
    }
}

/* LOGIN */
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
}

.login-card {
    width: min(520px, 100%);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.08);
}

.login-card h1 {
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.field {
    margin-bottom: 12px;
}

input[type="password"] {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 12px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text);
    outline: none;
}

input[type="password"]:focus {
    border-color: rgba(57, 124, 137, 0.6);
    box-shadow: 0 0 0 4px rgba(57, 124, 137, 0.15);
}

.btn {
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 12px 14px;
    font-weight: 700;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    background: var(--nav);
    color: #ffffff;
}

.btn:hover {
    background: var(--nav-hover);
}

.error {
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(220, 38, 38, 0.25);
    background: rgba(220, 38, 38, 0.06);
    color: #8f1d1d;
    font-weight: 600;
    font-size: 14px;
}

/* Back to Top button */
.back-to-top {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 9999;

    border: 0;
    border-radius: 999px;
    padding: 12px 14px;
    font-family: inherit;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.2px;

    background: var(--nav);
    color: #ffffff;
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.18);
    cursor: pointer;

    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 160ms ease, transform 160ms ease, background 160ms ease;
}

.back-to-top:hover,
.back-to-top:focus-visible {
    background: var(--nav-hover);
    outline: none;
}

.back-to-top.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

@media (max-width: 720px) {
    .back-to-top {
        right: 12px;
        bottom: 12px;
        padding: 10px 12px;
        font-size: 13px;
    }
}
