:root{
    --primary:#2457d6;
    --secondary:#17336d;
    --accent:#22a699;
    --background:#f5f7fb;
    --surface:#ffffff;
    --text:#172033;
    --border:#dce2ec;
    --success:#18794e;
    --warning:#9a6700;
    --danger:#c93737;
    --muted:#697386;
}

*{
    box-sizing:border-box;
}

html,
body{
    max-width:100%;
    overflow-x:hidden;
}

body{
    margin:0;
    background:var(--background);
    color:var(--text);
    font:16px/1.6 system-ui,sans-serif;
}

img,
svg,
canvas{
    max-width:100%;
}

header{
    position:relative;
    min-height:72px;
    padding:0 max(24px,calc((100% - 1100px)/2));
    display:flex;
    align-items:center;
    justify-content:space-between;
    background:var(--surface);
    border-bottom:1px solid var(--border);
}

.brand{
    display:flex;
    align-items:center;
    min-height:44px;
    text-decoration:none;
}

.brand img{
    display:block;
    width:145px;
    height:auto;
}

nav{
    display:flex;
    align-items:center;
    gap:8px;
}

nav > a,
nav > button,
nav > form > button{
    display:flex;
    align-items:center;
    min-height:44px;
}

/* General links */

a{
    color:var(--primary);
    text-decoration:none;
    transition:color .2s ease,background-color .2s ease;
}

a:hover{
    color:var(--secondary);
}

/* Header navigation links */

nav a{
    padding:8px 12px;
    color:var(--text);
    font-weight:500;
    border-radius:8px;
    text-decoration:none;
}

nav a:hover{
    color:var(--primary);
    background:#eef3ff;
    text-decoration:none;
}

nav a[aria-current="page"]{
    color:var(--primary);
    background:#eef3ff;
    font-weight:650;
    text-decoration:none;
}

nav form{
    margin:0;
}

nav button{
    border:0;
    background:none;
    color:var(--primary);
    padding:8px 12px;
    border-radius:8px;
    cursor:pointer;
}

nav button:hover{
    background:#eef3ff;
}

nav b{
    margin-left:4px;
    padding:1px 6px;
    background:var(--danger);
    color:#ffffff;
    border-radius:20px;
    font-size:11px;
}

.menu{
    display:none;
    align-items:center;
    justify-content:center;
    width:44px;
    height:44px;
    padding:8px;
    background:none;
    color:var(--primary);
    border:0;
    border-radius:8px;
    cursor:pointer;
}

.menu:hover{
    background:#eef3ff;
}

.menu img{
    display:block;
    width:24px;
    height:24px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible{
    outline:3px solid var(--accent);
    outline-offset:3px;
}

main{
    max-width:820px;
    min-width:0;
    min-height:calc(100vh - 130px);
    margin:auto;
    padding:48px 20px;
    overflow-wrap:anywhere;
}

.narrow{
    max-width:520px;
    margin:auto;
}

.card{
    min-width:0;
    margin-bottom:20px;
    padding:28px;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:16px;
    box-shadow:0 8px 30px rgba(24,40,72,.05);
}

h1{
    margin-top:0;
    font-size:clamp(1.6rem,4vw,1.9rem);
    line-height:1.25;
}

h2{
    font-size:1.25rem;
    line-height:1.35;
}

label{
    display:block;
    margin:14px 0 5px;
    font-weight:600;
}

input,
textarea,
select{
    width:100%;
    max-width:100%;
    min-height:44px;
    padding:11px 12px;
    background:#ffffff;
    border:1px solid var(--border);
    border-radius:9px;
    font:inherit;
}

input[type="checkbox"],
input[type="radio"]{
    width:1.25rem;
    height:1.25rem;
    min-height:1.25rem;
    padding:0;
    flex:0 0 auto;
}

textarea{
    min-height:130px;
    resize:vertical;
}

button{
    font:inherit;
}

.btn,
button.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:44px;
    margin-top:18px;
    padding:10px 16px;
    background:var(--primary);
    color:#ffffff;
    border:0;
    border-radius:9px;
    font-weight:650;
    line-height:1.25;
    text-align:center;
    text-decoration:none;
    cursor:pointer;
    transition:background-color .2s ease,transform .2s ease;
}

.btn:hover,
button.btn:hover{
    background:var(--secondary);
    color:#ffffff;
    text-decoration:none;
}

.btn:disabled,
button.btn:disabled{
    opacity:.45;
    cursor:not-allowed;
}

.danger{
    background:var(--danger)!important;
}

.muted{
    color:var(--muted);
}

.alert{
    margin-bottom:18px;
    padding:12px 16px;
    background:#eaf0ff;
    border:1px solid #cbd8f7;
    border-radius:9px;
}

.alert.error{
    background:#fff0f0;
    color:var(--danger);
}

.alert.success{
    background:#edf9f2;
    color:var(--success);
    border-color:#bfe3ce;
}

.avatar{
    width:72px;
    height:72px;
    object-fit:cover;
    border-radius:50%;
}

.grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
}

footer{
    padding:20px;
    color:var(--muted);
    text-align:center;
    border-top:1px solid var(--border);
}

footer .footer-links{
    position:static;
    display:flex;
    justify-content:center;
    flex-wrap:wrap;
    gap:8px 16px;
    max-height:none;
    margin:0;
    padding:0;
    overflow:visible;
    background:transparent;
    border:0;
    box-shadow:none;
}

footer .footer-links a{
    display:inline-flex;
    width:auto;
    min-height:44px;
    padding:6px 2px;
    text-align:center;
    text-decoration:none;
}

footer .footer-links a:hover{
    color:var(--secondary);
    text-decoration:none;
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width:1100px){

    header{
        padding:0 14px;
        flex-wrap:wrap;
    }

    .menu{
        display:flex;
    }

    nav{
        display:none;
        position:static;
        z-index:30;
        flex:1 0 calc(100% + 28px);
        flex-direction:column;
        align-items:stretch;
        gap:2px;
        max-height:calc(100vh - 72px);
        margin-inline:-14px;
        padding:10px 14px 16px;
        overflow:auto;
        overscroll-behavior:contain;
        background:#ffffff;
        border-top:1px solid var(--border);
        border-bottom:1px solid var(--border);
        box-shadow:0 14px 30px rgba(23,32,51,.12);
    }

    nav.open{
        display:flex;
    }

    nav a,
    nav button,
    nav form button{
        display:flex;
        align-items:center;
        width:100%;
        min-height:44px;
        padding:10px 12px;
        color:var(--text);
        text-align:left;
        border-radius:8px;
    }

    nav a:hover,
    nav button:hover{
        color:var(--primary);
        background:#eef3ff;
    }

    nav a[aria-current="page"]{
        color:var(--primary);
        background:#edf2ff;
        font-weight:650;
    }

    nav form,
    nav form button{
        width:100%;
    }

    .grid{
        grid-template-columns:1fr;
    }

    main{
        padding:26px 12px;
    }

    .card{
        padding:18px;
        border-radius:13px;
    }

    .btn,
    button.btn{
        max-width:100%;
        white-space:normal;
    }
}

@media (max-width:360px){

    .brand img{
        width:128px;
    }

    main{
        padding-inline:8px;
    }

    .card{
        padding:15px;
    }
}