:root {
    --surface: #ffffff;
    --surface-soft: rgba(255, 255, 255, 0.72);
    --text: #132238;
    --muted: #55657d;
    --border: rgba(19, 34, 56, 0.12);
    --shadow: 0 24px 60px rgba(18, 53, 91, 0.14);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background-image: var(--page-background);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

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

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

iframe {
    width: 100%;
    border: 0;
}

.page-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding: 18px 22px;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 8px);
    background: var(--surface-soft);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
}

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

.brand img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 16px;
}

.brand strong,
.section-head h2,
.hero h1,
.lesson-card h2,
.activity-block h3 {
    font-family: Georgia, "Times New Roman", serif;
}

.brand strong {
    display: block;
    font-size: 1.05rem;
}

.brand span,
.topbar-nav a,
.hero p,
.lesson-row span,
.lesson-row small,
.empty-state,
.attendance-summary span,
label span {
    color: var(--muted);
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.site-footer {
    display: flex;
    justify-content: center;
    padding: 12px 0 4px;
}

.hero,
.panel,
.lesson-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-soft);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(260px, 0.9fr);
    gap: 24px;
    padding: 36px;
    overflow: hidden;
}

.hero.compact {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

.hero h1,
.lesson-card h2 {
    margin: 0 0 10px;
    font-size: clamp(2rem, 3vw, 3.5rem);
    line-height: 1.05;
}

.hero.compact h1 {
    font-size: clamp(1.75rem, 2.4vw, 2.5rem);
}

.hero p {
    max-width: 60ch;
    margin: 0;
    line-height: 1.6;
}

.hero-meta {
    display: grid;
    gap: 14px;
}

.metric-card {
    padding: 20px;
    border-radius: 20px;
    background: color-mix(in srgb, var(--primary) 10%, white);
}

.metric-card strong {
    display: block;
    margin-bottom: 6px;
    color: var(--primary);
}

.hero-copy-only {
    grid-template-columns: 1fr;
}

.hero-banner {
    position: relative;
    min-height: 420px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.hero-banner img {
    width: 100%;
    height: 100%;
    min-height: 420px;
    object-fit: cover;
}

.hero-banner-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 12px;
    padding: 36px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.58));
    color: white;
}

.hero-banner-overlay p,
.hero-banner-overlay .eyebrow {
    color: rgba(255, 255, 255, 0.9);
}

.hero-banner-overlay h1 {
    margin: 0;
    max-width: 12ch;
    font-size: clamp(2.2rem, 4vw, 4.4rem);
    line-height: 0.98;
}

.hero-banner-overlay p {
    max-width: 56ch;
    margin: 0;
    line-height: 1.6;
}

.hero-metrics-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.panel {
    padding: 24px;
}

.auth-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
    gap: 24px;
    align-items: start;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.section-head h2,
.activity-block h3 {
    margin: 0;
    font-size: 1.7rem;
}

.stack {
    display: flex;
    flex-direction: column;
}

.gap-sm {
    gap: 12px;
}

.gap-md {
    gap: 18px;
}

.grid {
    display: grid;
    gap: 24px;
}

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

.three-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 600;
}

input,
select,
button {
    font: inherit;
}

input[type="text"],
input[type="url"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.85);
    color: var(--text);
}

input[type="file"],
input[type="color"] {
    width: 100%;
}

textarea {
    resize: vertical;
    min-height: 96px;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 18px;
    border: 0;
    border-radius: 16px;
    background: var(--primary);
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.button:hover,
button:hover {
    transform: translateY(-1px);
}

.button.ghost {
    background: rgba(255, 255, 255, 0.72);
    color: var(--primary);
    border: 1px solid var(--border);
}

.flash {
    margin-bottom: 16px;
    padding: 14px 18px;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.flash.success {
    background: rgba(51, 166, 121, 0.14);
}

.flash.error {
    background: rgba(239, 71, 111, 0.14);
}

.lesson-row,
.attendance-item,
.course-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.64);
}

.lesson-row strong,
.course-block strong {
    display: block;
    margin-bottom: 4px;
}

.lesson-metrics,
.course-block header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.teacher-access-meta {
    max-width: 340px;
    justify-content: flex-end;
}

.teacher-access-meta span {
    word-break: break-word;
    text-align: right;
}

.attendance-list {
    display: grid;
    gap: 12px;
}

.attendance-list.compact {
    gap: 8px;
}

.attendance-item input {
    width: 20px;
    height: 20px;
}

.attendance-item span {
    flex: 1;
}

.attendance-compact-row {
    display: grid;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.64);
}

.attendance-row-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.attendance-check {
    display: flex;
    align-items: center;
    justify-content: center;
}

.attendance-name-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    text-align: left;
    justify-content: flex-start;
    min-height: auto;
    font-weight: 700;
    cursor: pointer;
}

.attendance-name-button:hover {
    transform: none;
    color: var(--primary);
}

.attendance-status {
    min-width: 72px;
    text-align: right;
}

.attendance-notes-panel {
    padding-top: 4px;
}

.lesson-card {
    overflow: hidden;
}

.lesson-card summary {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 20px;
    align-items: center;
    padding: 18px;
    cursor: pointer;
    list-style: none;
}

.lesson-card summary::-webkit-details-marker {
    display: none;
}

.lesson-card summary img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 20px;
}

.lesson-card summary p {
    margin: 0;
    color: var(--muted);
}

.lesson-card-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 0 18px 18px;
}

.media-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
    gap: 20px;
}

.media-frame,
.attendance-panel,
.activity-block {
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
}

.media-frame iframe {
    min-height: 340px;
    border-radius: 14px;
}

.attendance-summary {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.attendance-summary li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.status-ok {
    color: #117a4a;
}

.status-off {
    color: var(--accent);
}

.activity-frame {
    min-height: 620px;
    border-radius: 16px;
}

.chip-list {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip-list li {
    padding: 8px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 10%, white);
}

.student-admin-list {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.student-admin-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--primary) 8%, white);
}

.student-compact-item {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.64);
    overflow: hidden;
}

.student-compact-summary {
    display: grid;
    grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.5fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    cursor: pointer;
    list-style: none;
}

.student-compact-summary::-webkit-details-marker {
    display: none;
}

.student-compact-name {
    color: var(--text);
}

.student-compact-comment,
.student-compact-absences,
.student-save-status {
    color: var(--muted);
}

.student-compact-absences {
    font-weight: 700;
    white-space: nowrap;
}

.student-compact-body {
    display: grid;
    gap: 14px;
    padding: 0 18px 18px;
    border-top: 1px solid var(--border);
}

.student-note-history {
    display: grid;
    gap: 12px;
}

.student-note-entry {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--border);
}

.student-note-entry-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.student-note-entry-head span {
    color: var(--muted);
    font-size: 0.9rem;
}

.student-empty-history {
    margin: 0;
}

.lesson-photo-grid,
.public-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.lesson-photo-card,
.public-photo-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.72);
}

.lesson-photo-thumb,
.public-photo-card {
    overflow: hidden;
    border-radius: 14px;
}

.lesson-photo-thumb img,
.public-photo-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.lesson-photo-meta {
    display: grid;
    gap: 4px;
}

.lesson-photo-meta strong,
.public-photo-card span {
    display: block;
    word-break: break-word;
}

.lesson-photo-meta span,
.public-photo-card span {
    color: var(--muted);
    font-size: 0.92rem;
}

.lesson-photo-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.inline-form {
    margin-bottom: 18px;
}

.inline-action {
    display: inline-flex;
}

.logo-preview {
    max-width: 180px;
    padding: 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid var(--border);
}

.background-preview {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid var(--border);
}

.credentials,
.empty-card {
    padding: 22px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid var(--border);
}

.small {
    font-size: 0.92rem;
}

.field-label {
    font-weight: 700;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.theme-option {
    position: relative;
}

.theme-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 124px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.74);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-option input:checked + .theme-card {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
    transform: translateY(-1px);
}

.theme-card small,
.theme-custom-note {
    color: var(--muted);
    line-height: 1.45;
}

.theme-swatches {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.theme-swatches i {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.checkbox-inline {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.checkbox-inline input {
    width: auto;
}

.notes-field span {
    display: inline-block;
    margin-bottom: 8px;
}

.button.danger {
    background: #b42318;
}

.danger-text {
    color: #b42318;
}

@media (max-width: 900px) {
    .hero,
    .hero.compact,
    .auth-panel,
    .two-columns,
    .three-columns,
    .media-grid,
    .lesson-card summary {
        grid-template-columns: 1fr;
    }

    .topbar,
    .course-block,
    .lesson-row,
    .attendance-item {
        align-items: flex-start;
    }

    .topbar {
        flex-direction: column;
    }

    .lesson-card summary img,
    .media-frame iframe,
    .activity-frame {
        min-height: 240px;
    }

    .hero-banner,
    .hero-banner img {
        min-height: 280px;
    }

    .hero-banner-overlay {
        padding: 22px;
    }

    .hero-banner-overlay h1 {
        max-width: none;
        font-size: clamp(1.9rem, 8vw, 3rem);
    }

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

    .hero-metrics-row {
        grid-template-columns: 1fr;
    }

    .student-compact-summary {
        grid-template-columns: 1fr;
    }
}
