:root{
    --bg-main:#0b1a33;
    --bg-card:#f3f5f9;
    --bg-card-soft:#ffffff;
    --text-main:#172033;
    --text-soft:#5f6b85;
    --primary:#4c6ef5;
    --primary-hover:#3f5de0;
    --danger:#e74c3c;
    --danger-hover:#c0392b;
    --success:#2ecc71;
    --warning:#f39c12;
    --border:#d9dfeb;
    --shadow:0 18px 45px rgba(0,0,0,0.28);
    --radius-lg:18px;
    --radius-md:12px;
    --radius-sm:8px;
}

*{
    box-sizing:border-box;
}

html,
body{
    margin:0;
    padding:0;
}

body{
    min-height:100vh;
    font-family:Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top, rgba(76,110,245,0.22), transparent 30%),
        linear-gradient(180deg, #07162d 0%, #0b1a33 100%);
    color:var(--text-main);
    display:flex;
    justify-content:center;
    align-items:center;
    padding:24px;
}

img{
    max-width:100%;
    display:block;
}

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

.main-card{
    width:1000px;
    max-width:100%;
    min-height:680px;
    background:var(--bg-card);
    border-radius:var(--radius-lg);
    box-shadow:var(--shadow);
    overflow:hidden;
    display:flex;
    flex-direction:column;
}

.header{
    background:linear-gradient(90deg,#3d5bd1,#4c6be3);
    color:#ffffff;
    font-weight:bold;
    padding:16px 22px;
    font-size:14px;
    letter-spacing:0.4px;
}

#content{
    flex:1;
    padding:30px 40px;
}

.site-footer{
    border-top:1px solid rgba(23,32,51,0.08);
    padding:22px 24px 26px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:12px;
    text-align:center;
}

.site-footer-discord-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:240px;
    min-height:46px;
    padding:12px 20px;
    border:none;
    border-radius:14px;
    background:linear-gradient(90deg,#5865F2,#6b75f5);
    color:#ffffff;
    text-decoration:none;
    font-weight:800;
    font-size:15px;
    box-shadow:0 10px 20px rgba(88,101,242,0.22);
    transition:transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.site-footer-discord-btn:hover{
    transform:translateY(-2px);
    filter:brightness(1.03);
    box-shadow:0 14px 24px rgba(88,101,242,0.28);
}

.site-footer-meta{
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    align-items:center;
    gap:8px;
    font-size:14px;
    line-height:1.6;
    color:var(--text-soft);
}

.site-footer-meta a{
    color:#3e59c7;
    font-weight:bold;
    text-decoration:none;
}

.site-footer-meta a:hover{
    text-decoration:underline;
}

/* =========================
   ROUTER
========================= */

.router-loading{
    min-height:360px;
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    color:var(--text-soft);
    font-size:18px;
    font-weight:bold;
}

.router-error-box{
    max-width:520px;
    margin:60px auto;
    background:#ffffff;
    border:1px solid var(--border);
    border-radius:16px;
    padding:28px;
    text-align:center;
    box-shadow:0 10px 24px rgba(0,0,0,0.08);
}

.router-error-box h2{
    margin:0 0 12px;
    color:var(--text-main);
}

.router-error-box p{
    margin:0 0 18px;
    color:var(--text-soft);
    line-height:1.6;
}

.router-error-box button{
    border:none;
    background:var(--primary);
    color:#ffffff;
    padding:12px 18px;
    border-radius:10px;
    cursor:pointer;
    font-weight:bold;
}

.router-error-box button:hover{
    background:var(--primary-hover);
}

/* =========================
   HOME
========================= */

.home{
    display:flex;
    flex-direction:column;
    gap:26px;
}

.home-top{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:24px;
    padding-bottom:8px;
    border-bottom:1px solid rgba(23,32,51,0.08);
}

.home-brand{
    display:flex;
    align-items:flex-start;
}

.logo{
    width:260px;
    max-width:100%;
}

.home-top-discord{
    display:flex;
    justify-content:flex-end;
    align-items:flex-start;
    min-height:auto;
    width:320px;
    max-width:100%;
}

.home-hero-section,
.home-exams-section{
    background:var(--bg-card-soft);
    border:1px solid var(--border);
    border-radius:16px;
    padding:24px;
    box-shadow:0 8px 20px rgba(0,0,0,0.05);
}

.home-intro{
    text-align:left;
}

.home-intro h2{
    margin:0 0 10px;
    font-size:34px;
    color:var(--text-main);
}

.home-intro p{
    margin:0;
    color:var(--text-soft);
    line-height:1.7;
    font-size:15px;
}

.home-section-header{
    margin-bottom:18px;
}

.home-section-header h3{
    margin:0 0 8px;
    font-size:22px;
    color:var(--text-main);
}

.home-section-header p{
    margin:0;
    color:var(--text-soft);
    line-height:1.6;
}

.discord-container{
    display:flex;
    justify-content:flex-end;
    align-items:flex-start;
    width:100%;
}

.discord-identity-card{
    width:100%;
    max-width:300px;
    background:#ffffff;
    border:1px solid var(--border);
    border-radius:16px;
    padding:16px;
    box-shadow:0 8px 18px rgba(0,0,0,0.06);
}

.discord-identity-main{
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:14px;
}

.discord-identity-text{
    min-width:0;
    text-align:left;
}

.discord-role{
    font-size:13px;
    color:var(--text-soft);
    line-height:1.4;
}

.discord-identity-actions{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

.discord-avatar{
    width:78px;
    height:78px;
    margin:0 auto 12px;
    border-radius:50%;
    border:3px solid #5865F2;
    object-fit:cover;
}

.discord-avatar.compact{
    width:58px;
    height:58px;
    margin:0;
    border-width:2px;
}

.discord-name{
    font-size:18px;
    font-weight:bold;
    margin-bottom:2px;
    word-break:break-word;
}

.discord-name.compact{
    margin:0 0 4px;
    font-size:20px;
}

.discord-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    min-width:160px;
    border:none;
    background:#5865F2;
    color:#ffffff;
    padding:11px 18px;
    border-radius:10px;
    font-weight:bold;
    cursor:pointer;
    transition:transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.discord-btn-small{
    min-width:0;
    padding:10px 14px;
}

.discord-btn:hover{
    background:#4752c4;
    transform:translateY(-1px);
    box-shadow:0 8px 18px rgba(88,101,242,0.28);
}

.logout-btn{
    background:var(--danger);
}

.logout-btn:hover{
    background:var(--danger-hover);
    box-shadow:0 8px 18px rgba(231,76,60,0.25);
}

.exam-types{
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:22px;
}

.card{
    width:100%;
}

.exam-card-button{
    border:none;
    background:transparent;
    padding:0;
    text-align:center;
    cursor:pointer;
    transition:transform 0.18s ease;
}

.exam-card-button:hover{
    transform:translateY(-3px);
}

.exam-card-button img{
    width:100%;
    height:280px;
    object-fit:cover;
    border-radius:16px;
    box-shadow:0 12px 24px rgba(0,0,0,0.18);
    border:1px solid rgba(23,32,51,0.08);
    background:#dfe5f2;
}

.exam-card-button p{
    margin:12px 0 0;
    font-size:17px;
    font-weight:bold;
    color:var(--text-main);
}

.home-message{
    width:100%;
    padding:18px;
    border-radius:12px;
    text-align:center;
    font-weight:bold;
    border:1px solid transparent;
}

.home-message-info{
    background:#eef3ff;
    color:#3552b6;
    border-color:#d4defd;
}

.home-message-warning{
    background:#fff6df;
    color:#9c6b00;
    border-color:#f0dd9a;
}

.home-message-error{
    background:#fdecec;
    color:#b03a2e;
    border-color:#f3c4bf;
}

/* =========================
   HELPERS
========================= */

.hidden{
    display:none !important;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width:980px){
    body{
        padding:16px;
        align-items:center;
    }

    .main-card{
        min-height:auto;
    }

    #content{
        padding:24px;
    }

    .home-top{
        flex-direction:column;
        align-items:center;
        text-align:center;
    }

    .home-brand{
        justify-content:center;
    }

    .home-top-discord,
    .discord-container{
        justify-content:center;
    }

    .home-intro{
        text-align:center;
    }

    .exam-types{
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }
}

@media (max-width:700px){
    .header{
        padding:14px 18px;
        font-size:13px;
    }

    #content{
        padding:18px;
    }

    .home{
        gap:18px;
    }

    .home-hero-section,
    .home-exams-section{
        padding:18px;
    }

    .home-intro h2{
        font-size:28px;
    }

    .exam-types{
        grid-template-columns:1fr;
    }

    .exam-card-button img{
        height:240px;
    }

    .discord-identity-card{
        max-width:100%;
    }

    .discord-identity-main{
        align-items:center;
    }

    .discord-identity-text{
        text-align:left;
    }

    .discord-identity-actions{
        flex-direction:column;
    }

    .discord-btn-small,
    .discord-btn{
        width:100%;
    }

    .site-footer{
        padding:18px;
        gap:10px;
    }

    .site-footer-discord-btn{
        width:100%;
        min-width:0;
    }

    .site-footer-meta{
        flex-direction:column;
        gap:4px;
    }
}