/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:wght@600;700;800&family=DM+Mono:wght@400;500&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&display=swap');

:root {
    --ink:        #002938;
    --paper:      #eaf2f8;
    --cream:      #dde9f2;
    --accent:     #006789;
    --accent2:    #0290bf;
    --muted:      #5a7382;
    --border:     #bdd0dc;
    --white:      #ffffff;
    --shadow:     rgba(0,41,56,.12);
    --radius:     4px;
    --radius-lg:  10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--paper);
    color: var(--ink);
    min-height: 100vh;
    line-height: 1.6;
}

body.section-admin {
    background: #e5eef5;
}

/* ── LAYOUT ── */
.site-header {
    background: var(--ink);
    color: var(--paper);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid var(--accent);
}

.site-header-admin {
    background: #00364a;
    border-bottom-color: var(--accent2);
}

.site-header-admin .logo span { color: var(--accent2); }
.site-header-admin .header-nav a.active,
.site-header-admin .header-nav a:hover { color: var(--accent2); }

.site-header .logo {
    font-family: 'Source Serif 4', serif;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -.02em;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.site-header .logo span { color: var(--accent); }

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-nav { display: flex; gap: 1.5rem; }
.header-nav a {
    color: var(--paper);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 500;
    opacity: .7;
    transition: opacity .2s;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.header-nav a:hover, .header-nav a.active { opacity: 1; color: var(--accent); }

.partner-brand {
    display: flex;
    align-items: center;
    border-left: 1px solid rgba(255,255,255,.25);
    padding-left: .7rem;
}
.partner-brand img {
    display: block;
    height: 16px;
    width: auto;
}

@media(max-width:760px){
    .site-header { padding: 0 1rem; }
    .header-nav { gap: .8rem; }
    .partner-brand {
        padding-left: .6rem;
    }
    .partner-brand img { height: 14px; }
}

.container { max-width: 900px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.container-wide { max-width: 1200px; margin: 0 auto; padding: 2.5rem 1.5rem; }

/* ── TYPOGRAPHY ── */
h1, h2, h3 { font-family: 'Source Serif 4', serif; line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.4rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; }

.mono { font-family: 'DM Mono', monospace; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.accent2 { color: var(--accent2); }

/* ── CARDS ── */
.card {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: 0 2px 8px var(--shadow);
}

.card-sm { padding: 1.25rem; }

/* ── HERO ── */
.hero {
    padding: 4rem 0 3rem;
    border-bottom: 1.5px solid var(--border);
    margin-bottom: 3rem;
}
.hero-meta {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.badge {
    font-family: 'DM Mono', monospace;
    font-size: .72rem;
    padding: .25rem .65rem;
    border-radius: 100px;
    border: 1.5px solid var(--border);
    background: var(--cream);
    color: var(--muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.badge-accent  { border-color: var(--accent);  color: var(--accent);  background: #e6f1f7; }
.badge-accent2 { border-color: var(--accent2); color: var(--accent2); background: #e4f4fa; }

/* ── FORM ── */
.form-group { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.25rem; }
.form-group label {
    font-size: .82rem;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
}
.form-control, .form-select {
    width: 100%;
    padding: .65rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--ink);
    font-family: 'DM Sans', sans-serif;
    font-size: .95rem;
    transition: border-color .2s, box-shadow .2s;
    appearance: none;
}
.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0,103,137,.16);
}
.form-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='%237a7060'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .9rem center; padding-right: 2.5rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media(max-width:600px){ .form-row { grid-template-columns: 1fr; } }

.topic-link-row { grid-template-columns: 1fr 1fr auto; align-items: start; margin-bottom: .85rem; }
.topic-link-row .form-group { margin-bottom: 0; }
.topic-link-row:last-child { margin-bottom: 0; }
@media(max-width:600px){ .topic-link-row { grid-template-columns: 1fr; } }

.role-checkboxes { display: flex; gap: .75rem; flex-wrap: wrap; }
.role-check { display: flex; align-items: center; gap: .4rem; }
.role-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.role-check label { font-size: .9rem; cursor: pointer; }

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem 1.4rem;
    border-radius: var(--radius);
    border: none;
    font-family: 'DM Sans', sans-serif;
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all .18s;
    letter-spacing: .02em;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary[aria-disabled="true"] {
    opacity: .72;
}
.btn-primary:hover { background: #025978; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,103,137,.3); }
.btn-secondary {
    background: var(--cream);
    color: var(--ink);
    border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }
.btn-ghost { background: transparent; color: var(--muted); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--cream); color: var(--ink); }
.btn-danger { background: #c0392b; color: #fff; }
.btn-danger:hover { background: #a93226; }
.btn-sm { padding: .4rem .9rem; font-size: .82rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── QUIZ QUESTION ── */
.question-card {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
    transition: box-shadow .2s;
}
.question-card:hover { box-shadow: 0 4px 16px var(--shadow); }

.question-header {
    padding: 1.25rem 1.5rem;
    background: var(--cream);
    border-bottom: 1.5px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}
.question-num {
    font-family: 'Source Serif 4', serif;
    font-weight: 800;
    font-size: 2rem;
    color: var(--border);
    line-height: 1;
    flex-shrink: 0;
    width: 2rem;
}
.question-text {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    padding-top: .35rem;
}
.question-area-badge { margin-left: auto; flex-shrink: 0; }

.question-options { padding: 1rem 1.5rem 1.25rem; display: flex; flex-direction: column; gap: .6rem; }

.option-label {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all .15s;
    background: var(--paper);
}
.option-label:hover { border-color: var(--accent); background: #eaf4f9; }
.option-label input[type=radio] { display: none; }
.option-label input[type=radio]:checked + .option-letter { background: var(--accent); color: #fff; border-color: var(--accent); }
.option-label:has(input:checked) { border-color: var(--accent); background: #eaf4f9; }

.option-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'DM Mono', monospace;
    font-size: .78rem;
    font-weight: 500;
    flex-shrink: 0;
    transition: all .15s;
    text-transform: uppercase;
}
.option-text { font-size: .9rem; }

/* ── RESULT STATES ── */
.option-label.correct { border-color: var(--accent2); background: #e8f2ed; }
.option-label.wrong   { border-color: #c0392b; background: #fceae9; }
.option-label.correct .option-letter { background: var(--accent2); color: #fff; border-color: var(--accent2); }
.option-label.wrong .option-letter   { background: #c0392b; color: #fff; border-color: #c0392b; }

/* ── SCORE PANEL ── */
.score-panel {
    background: var(--ink);
    color: var(--paper);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}
.score-big {
    font-family: 'Source Serif 4', serif;
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
}
.score-sub { opacity: .6; font-size: .9rem; margin-top: .25rem; }
.score-bar-wrap { background: rgba(255,255,255,.15); border-radius: 100px; height: 8px; margin: 1.25rem 0; overflow: hidden; }
.score-bar { height: 100%; border-radius: 100px; background: var(--accent); transition: width 1s ease; }

/* ── TABLE ── */
table { width: 100%; border-collapse: collapse; }
thead th {
    padding: .75rem 1rem;
    text-align: left;
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    border-bottom: 2px solid var(--border);
    background: var(--cream);
}
tbody td { padding: .85rem 1rem; border-bottom: 1px solid var(--border); font-size: .9rem; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--cream); }

/* ── ALERT ── */
.alert { padding: .9rem 1.1rem; border-radius: var(--radius); border: 1.5px solid; margin-bottom: 1.25rem; font-size: .9rem; }
.alert-success { background: #e8f2ed; border-color: var(--accent2); color: #1a4a36; }
.alert-error   { background: #fceae9; border-color: #c0392b; color: #7b1e1e; }
.alert-info    { background: #e8eef8; border-color: #3b6ab5; color: #1e3a6e; }

.incomplete-warning {
    display: none;
    width: 100%;
    margin-bottom: .75rem;
}
.incomplete-warning.is-visible { display: block; }

/* ── START FORM CARD ── */
.start-card {
    max-width: 520px;
    margin: 5vh auto;
}
.start-card .card { padding: 2.5rem; }

.week-role-form {
    display: flex;
    align-items: end;
    gap: .75rem;
    flex-wrap: wrap;
}
.week-role-form .form-group {
    min-width: 260px;
    flex: 1;
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.week-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.1rem;
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.week-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 18px rgba(0,41,56,.16);
    border-color: var(--accent);
}
.week-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .5rem;
}
.week-card h3 {
    margin-bottom: .35rem;
}
.week-card p {
    font-size: .9rem;
    line-height: 1.4;
}

.topic-stack {
    display: flex;
    flex-direction: column;
    gap: .9rem;
}
.topic-card {
    padding: 1.1rem 1.2rem;
}
.topic-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .7rem;
}

.topic-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}
.topic-links a {
    font-size: .92rem;
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(0,103,137,.25);
}
.topic-links a:hover {
    color: #025978;
    border-bottom-color: rgba(2,89,120,.5);
}

@media(max-width:900px){
    .week-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media(max-width:620px){
    .week-grid {
        grid-template-columns: 1fr;
    }
    .week-role-form .form-group {
        min-width: 100%;
    }
}

/* ── PROGRESS ── */
.progress-bar-outer { height: 4px; background: var(--border); border-radius: 2px; margin-bottom: 2rem; overflow: hidden; }
.progress-bar-inner { height: 100%; background: var(--accent); border-radius: 2px; transition: width .4s ease; }

/* ── ADMIN SIDEBAR ── */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; align-items: start; }
@media(max-width:768px){ .admin-layout { grid-template-columns: 1fr; } }

.sidebar {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    position: sticky;
    top: 80px;
}
.sidebar h3 { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .75rem; }
.sidebar-nav { list-style: none; display: flex; flex-direction: column; gap: .2rem; }
.sidebar-nav a {
    display: block;
    padding: .55rem .8rem;
    border-radius: var(--radius);
    color: var(--ink);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    transition: background .15s;
}
.sidebar-nav a:hover { background: var(--cream); }
.sidebar-nav a.active { background: var(--accent); color: #fff; }

/* ── MISC ── */
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }
.text-center { text-align: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-gap { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }

.area-soft_skills { background: #ecf3f9; color: #1d6d93; border-color: #bed4e3; }
.area-company     { background: #e6f4f8; color: #0f7a9c; border-color: #add4e3; }
.area-git         { background: #e5eff5; color: #1a5978; border-color: #b7cad7; }
.area-processes   { background: #edf5fb; color: #2e6f92; border-color: #bfd5e5; }

.role-pill {
    font-size: .7rem;
    padding: .15rem .5rem;
    border-radius: 100px;
    background: var(--cream);
    border: 1px solid var(--border);
    font-family: 'DM Mono', monospace;
}

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state .icon { font-size: 3rem; margin-bottom: .75rem; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.animate-up { animation: fadeUp .4s ease both; }
.delay-1 { animation-delay: .05s; } .delay-2 { animation-delay: .1s; } .delay-3 { animation-delay: .15s; }
