:root {
    --background: #f7f4f8;
    --surface: #ffffff;
    --surface-soft: #f1ecf6;
    --surface-warm: #fbf8f5;
    --text: #211a2b;
    --text-soft: #4f475a;
    --muted: #746d7d;
    --primary: #6b3fa0;
    --primary-dark: #4c2b73;
    --primary-soft: #a982d0;
    --accent: #35213f;
    --border: #e5dfea;
    --shadow: 0 18px 50px rgba(55, 34, 73, 0.08);
    --container: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

img {
    max-width: 100%;
}

.container {
    width: min(var(--container), calc(100% - 48px));
    margin: 0 auto;
}

h1,
h2,
h3 {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.site-header {
    position: relative;
    z-index: 20;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
}

.site-header > .container {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-header nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-header nav a {
    color: var(--text-soft);
    font-weight: 600;
}

.site-header nav a:hover {
    color: var(--primary);
}

.logo {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.1rem;
    font-weight: 600;
}

.home-header {
    position: sticky;
    top: 0;
    backdrop-filter: blur(16px);
}

.header-inner {
    min-height: 82px;
    display: flex;
    align-items: center;
    gap: 34px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.brand-mark {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 14px;
    background: #fff;
}

.brand-copy {
    display: grid;
    gap: 3px;
}

.brand-copy strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.08rem;
    font-weight: 600;
}

.brand-copy small {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    margin-left: auto;
}

.main-nav a {
    color: var(--text-soft);
    font-size: 0.94rem;
    font-weight: 600;
}

.main-nav a:hover {
    color: var(--primary);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 10px;
    font-weight: 700;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

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

.button-primary {
    background: linear-gradient(135deg, var(--primary), #7c4db0);
    color: #fff;
    box-shadow: 0 10px 28px rgba(107, 63, 160, 0.22);
}

.button-secondary {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid #9d7abe;
    color: var(--primary-dark);
}

.button-header {
    margin-left: 8px;
    min-height: 42px;
    background: var(--accent);
    color: #fff;
}

.eyebrow {
    margin: 0 0 14px;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero-premium {
    overflow: hidden;
    background:
        radial-gradient(circle at 82% 20%, rgba(169, 130, 208, 0.22), transparent 30%),
        linear-gradient(120deg, #fbf9fb 0%, #f5eff8 58%, #eee4f4 100%);
    border-bottom: 1px solid var(--border);
}

.hero-grid {
    min-height: 620px;
    display: grid;
    grid-template-columns: 1.08fr .92fr;
    gap: 66px;
    align-items: center;
    padding-top: 76px;
    padding-bottom: 76px;
}

.hero-copy {
    position: relative;
    z-index: 2;
}

.hero h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(3rem, 5.2vw, 5.35rem);
    line-height: .98;
}

.hero h1 span {
    display: block;
    margin-top: 12px;
    color: var(--primary);
    font-size: .72em;
    font-style: italic;
    font-weight: 500;
}

.hero-description {
    max-width: 680px;
    margin: 28px 0 0;
    color: var(--text-soft);
    font-size: 1.13rem;
    line-height: 1.72;
}

.hero-actions {
    display: flex;
    gap: 14px;
    margin-top: 34px;
}

.hero-proof {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 30px;
}

.hero-proof span {
    padding: 8px 12px;
    border: 1px solid rgba(107, 63, 160, .16);
    border-radius: 999px;
    background: rgba(255, 255, 255, .52);
    color: var(--text-soft);
    font-size: .84rem;
    font-weight: 650;
}

.hero-visual {
    position: relative;
    min-height: 470px;
    border: 1px solid rgba(107, 63, 160, .14);
    border-radius: 28px;
    background:
        linear-gradient(145deg, rgba(255,255,255,.76), rgba(236,225,244,.86));
    box-shadow: var(--shadow);
    overflow: hidden;
}

.hero-watermark {
    position: absolute;
    inset: 8% 4% auto auto;
    width: 72%;
    opacity: .11;
    mix-blend-mode: multiply;
}

.hero-watermark img {
    display: block;
    width: 100%;
    border-radius: 30px;
}

.hero-note {
    position: absolute;
    top: 48px;
    right: 38px;
    display: grid;
    gap: 7px;
    color: var(--primary-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.22rem;
    font-style: italic;
    text-align: right;
    transform: rotate(-2deg);
}

.hero-book-stack {
    position: absolute;
    right: 42px;
    bottom: 42px;
    left: 42px;
    display: grid;
    gap: 10px;
}

.hero-book-stack div {
    width: 78%;
    margin-left: auto;
    padding: 16px 26px;
    border: 1px solid rgba(70, 48, 80, .14);
    border-radius: 8px 15px 15px 8px;
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 12px 25px rgba(46, 28, 56, .07);
    color: var(--accent);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.02rem;
    letter-spacing: .11em;
    text-align: center;
}

.hero-book-stack div:nth-child(2) {
    width: 88%;
    background: rgba(229, 217, 239, .88);
}

.hero-book-stack div:nth-child(3) {
    width: 96%;
    background: rgba(92, 59, 115, .9);
    color: #fff;
}

.study-paths,
.latest-resources,
.editorial-section {
    padding: 92px 0;
}

.study-paths {
    background: #fff;
}

.section-heading {
    display: grid;
    grid-template-columns: 1fr minmax(280px, 440px);
    gap: 60px;
    align-items: end;
    margin-bottom: 42px;
}

.section-heading h2,
.editorial-section h2,
.home-cta h2 {
    margin: 0;
    font-size: clamp(2.1rem, 3.6vw, 3.4rem);
    line-height: 1.08;
}

.section-heading > p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.study-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.study-card {
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, #fff, #fbf9fc);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.study-card:hover {
    transform: translateY(-3px);
    border-color: #cfbddf;
    box-shadow: var(--shadow);
}

.study-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin-bottom: 24px;
    border-radius: 14px;
    background: var(--surface-soft);
    color: var(--primary);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    font-weight: 700;
}

.study-card h3,
.resource-card h3 {
    margin: 0;
    font-size: 1.35rem;
}

.study-card p,
.resource-card p {
    color: var(--muted);
    line-height: 1.65;
}

.study-card a,
.resource-card a {
    color: var(--primary);
    font-size: .92rem;
    font-weight: 750;
}

.latest-resources {
    background: var(--surface-warm);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-heading-inline {
    display: block;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

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

.resource-card,
.resource-empty {
    min-height: 250px;
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(50, 32, 59, .045);
}

.resource-card {
    display: flex;
    flex-direction: column;
}

.resource-card-image {
    aspect-ratio: 16 / 9;
    margin: -26px -26px 22px;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    border-radius: 15px 15px 0 0;
    background: var(--surface-soft);
}

.resource-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.resource-detail-image {
    width: min(100%, 920px);
    aspect-ratio: 16 / 9;
    margin: 34px 0 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface-soft);
    box-shadow: var(--shadow);
}

.resource-detail-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-article > .resource-detail-image {
    margin: 28px 0 40px;
}

.written-card > .resource-card-image {
    margin: -30px -30px 24px;
    border-radius: 19px 19px 0 0;
}

.resource-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
}

.resource-type,
.resource-premium {
    color: var(--primary);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.resource-premium {
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--surface-soft);
}

.resource-card p {
    flex: 1;
}

.resource-card a {
    margin-top: auto;
}

/* Shared illustrated catalogue cards: texts, training subjects and grammar. */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.catalog-card {
    min-width: 0;
}

.catalog-card > .resource-card-image {
    flex: none;
}

.catalog-card > .resource-card-top {
    margin-bottom: 20px;
}

.catalog-card .resource-card-top p {
    flex: none;
    margin: 0;
}

.written-page .catalog-card > h2,
.written-page .catalog-card > h3 {
    margin: 0 0 18px;
    font-size: clamp(1.45rem, 2.2vw, 1.85rem);
    line-height: 1.2;
}

.written-page .catalog-card > p {
    flex: 1;
    margin: 0 0 24px;
    line-height: 1.7;
}

.catalog-card h3 a {
    margin-top: 0;
    color: inherit;
    text-decoration: none;
}

.catalog-card h3 a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

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

@media (max-width: 720px) {
    .catalog-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.editorial-section {
    background: #fff;
}

.editorial-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 90px;
    align-items: center;
}

.editorial-copy {
    color: var(--text-soft);
    font-size: 1.08rem;
    line-height: 1.8;
}

.editorial-values {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.editorial-values span {
    padding: 9px 14px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--primary-dark);
    font-weight: 700;
}

.home-cta {
    padding: 54px 0;
    background: linear-gradient(135deg, #34203f, #5b3673 62%, #6b3fa0);
    color: #fff;
}

.home-cta .eyebrow {
    color: #d9c4ed;
}

.cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 36px;
}

.button-light {
    background: #fff;
    color: var(--primary-dark);
}

.site-footer {
    padding: 34px 0;
    background: #211828;
    color: #fff;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.footer-brand .brand-mark {
    width: 52px;
    height: 52px;
}

.footer-brand .brand-copy small,
.site-footer p {
    color: #bdb0c6;
}

.site-footer p {
    margin: 0;
    font-size: .85rem;
}

/* Content page */

.content-page {
    padding: 72px 0 110px;
    background: #fff;
}

.content-article {
    max-width: 820px;
}

.content-article h1 {
    margin: 12px 0 20px;
    font-size: clamp(2.4rem, 5vw, 4rem);
    line-height: 1.06;
}

.content-excerpt {
    margin: 0 0 32px;
    color: var(--muted);
    font-size: 1.2rem;
    line-height: 1.7;
}

.content-status {
    display: inline-block;
    margin: 0 0 24px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--primary);
    font-weight: 600;
}

.content-body {
    font-size: 1.05rem;
    line-height: 1.8;
}

.content-meta {
    margin-top: 48px;
    color: var(--muted);
    font-size: 0.9rem;
}

@media (max-width: 1040px) {
    .main-nav {
        display: none;
    }

    .button-header {
        margin-left: auto;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .hero-copy {
        max-width: 760px;
    }

    .hero-visual {
        min-height: 390px;
    }

    .study-grid,
    .resource-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 720px) {
    .container {
        width: min(100% - 28px, var(--container));
    }

    .header-inner {
        min-height: 72px;
    }

    .brand-mark {
        width: 48px;
        height: 48px;
    }

    .brand-copy strong {
        font-size: .98rem;
    }

    .brand-copy small {
        display: none;
    }

    .button-header {
        min-height: 38px;
        padding: 0 14px;
        font-size: .86rem;
    }

    .hero-grid {
        gap: 38px;
        padding-top: 56px;
        padding-bottom: 56px;
    }

    .hero h1 {
        font-size: clamp(2.55rem, 13vw, 4rem);
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-actions .button {
        width: 100%;
    }

    .hero-visual {
        min-height: 330px;
    }

    .hero-note {
        top: 32px;
        right: 28px;
        font-size: 1rem;
    }

    .hero-book-stack {
        right: 22px;
        bottom: 24px;
        left: 22px;
    }

    .hero-book-stack div {
        padding: 13px 18px;
    }

    .study-paths,
    .latest-resources,
    .editorial-section {
        padding: 68px 0;
    }

    .section-heading,
    .editorial-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .study-grid,
    .resource-grid {
        grid-template-columns: 1fr;
    }

    .resource-detail-image {
        margin-top: 26px;
        border-radius: 18px;
    }

    .cta-inner,
    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .home-cta .button {
        width: 100%;
    }
}



/* Unpublished resources */

.admin-preview-notice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 24px;
    padding: 11px 14px;
    border: 1px solid #d7b75f;
    border-radius: 10px;
    background: #fff8dc;
    color: #5c4613;
    font-size: .9rem;
    line-height: 1.5;
}

.admin-preview-notice strong {
    font-weight: 800;
}

.admin-preview-notice span {
    color: #6d581f;
}

.resource-unavailable-page {
    min-height: calc(100vh - 82px);
    display: grid;
    align-items: center;
    padding: 64px 0 88px;
    background:
        radial-gradient(circle at 80% 10%, rgba(169, 130, 208, .18), transparent 30%),
        var(--surface-warm);
}

.resource-unavailable-wrap {
    display: flex;
    justify-content: center;
}

.resource-unavailable-card {
    width: min(780px, 100%);
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 34px;
    align-items: center;
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(255, 255, 255, .92);
    box-shadow: var(--shadow);
}

.resource-unavailable-visual {
    aspect-ratio: 16 / 9;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-soft);
}

.resource-unavailable-visual img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.resource-unavailable-copy h1 {
    margin: 0 0 14px;
    font-size: clamp(2rem, 4vw, 3rem);
}

.resource-unavailable-copy > p:not(.eyebrow) {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.75;
}

.resource-unavailable-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

@media (max-width: 700px) {
    .resource-unavailable-page {
        padding: 42px 0 64px;
    }

    .resource-unavailable-card {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 24px;
    }

    .resource-unavailable-visual {
        width: min(260px, 100%);
    }

    .resource-unavailable-actions {
        flex-direction: column;
    }

    .resource-unavailable-actions .button {
        width: 100%;
    }
}

/* Back-office utility styles
   Deliberately neutral: these styles improve readability without defining
   the final visual identity of the administration interface. */

.admin-page {
    padding: 48px 0 80px;
}

.admin-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}

.admin-heading h1 {
    margin: 6px 0;
}

.admin-heading p {
    margin-bottom: 0;
    color: var(--muted);
}

.admin-header {
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

.admin-nav a {
    color: var(--text-soft);
    font-weight: 650;
}

.admin-nav a[aria-current] { color: var(--primary); text-decoration: underline; text-underline-offset: 5px; }
.admin-header a:focus-visible, .admin-users-page a:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.admin-user-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.admin-user-counts > div { display: flex; align-items: center; gap: 14px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.admin-user-counts strong { color: var(--primary); font-size: 2rem; }
.admin-user-counts span { color: var(--text-soft); }
.admin-user-email { overflow-wrap: anywhere; font-weight: 600; }
.admin-user-detail { display: block; margin-top: 5px; font-size: .85rem; color: var(--muted); }
.admin-user-detail.is-expired { color: #944c17; }
.user-status { display: inline-block; padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px; font-size: .85rem; font-weight: 700; white-space: nowrap; }
.user-status-admin { background: #edf5fb; border-color: #a5c5df; color: #244e70; }
.user-status-premium { background: #f6f0fb; border-color: #c9b8ef; color: var(--primary-dark); }
.user-status-free { background: #f7f5f6; color: var(--text-soft); }
.admin-user-back { display: inline-block; margin-bottom: 24px; color: var(--primary-dark); }
.admin-user-edit-card { max-width: 720px; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.admin-user-form input[type="date"] { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 7px; background: #fff; color: var(--text); font: inherit; }
.admin-user-form select:disabled { background: var(--surface-soft); color: var(--muted); }
.admin-user-form .help-text { margin-top: 8px; color: var(--muted); font-size: .9rem; line-height: 1.6; }
.admin-user-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 8px; margin-bottom: 0 !important; }
.admin-user-actions button { cursor: pointer; font: inherit; }
@media (max-width: 760px) {
    .admin-header .header-inner { flex-wrap: wrap; gap: 16px; padding: 18px 0; }
    .admin-nav { width: 100%; margin-left: 0; flex-wrap: wrap; gap: 12px 20px; }
    .admin-nav a { font-size: .9rem; }
    .admin-user-counts { gap: 8px; }
    .admin-user-counts > div { flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 10px; }
    .admin-user-counts span { font-size: .8rem; }
    .admin-users-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
    .admin-users-table, .admin-users-table tbody { display: block; }
    .admin-users-table tr { display: grid; padding: 14px; border-bottom: 1px solid var(--border); }
    .admin-users-table tr:last-child { border-bottom: 0; }
    .admin-users-table td { display: block; padding: 8px 0; border: 0; }
    .admin-users-table td::before { content: attr(data-label); display: block; margin-bottom: 5px; color: var(--muted); font-size: .8rem; }
    .admin-user-edit-card { padding: 20px; }
    .admin-user-actions { flex-direction: column; }
    .admin-user-actions .button { text-align: center; }
}

.admin-info {
    margin-bottom: 24px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 10px;
    background: var(--surface-soft);
}

.admin-info p {
    margin: 6px 0 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.admin-settings-card { max-width: 880px; }
.admin-settings-card h2 { margin-top: 0; }
.admin-settings-card form { margin-top: 22px; }
.admin-settings-card [role="switch"] { white-space: normal; text-align: center; }

.admin-inline-form {
    display: inline;
    margin: 0 !important;
}

.admin-toggle {
    min-width: 94px;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--text-soft);
    font: inherit;
    font-size: .82rem;
    font-weight: 750;
    cursor: pointer;
}

.admin-toggle:hover {
    border-color: var(--primary);
}

.admin-toggle.is-on {
    border-color: #9fc9aa;
    background: #f2faf4;
    color: #2d6d3f;
}

.admin-toggle.is-off {
    background: #f7f5f6;
    color: #706773;
}

.admin-toggle.is-premium {
    border-color: #c9b8ef;
    background: #f6f0fb;
    color: var(--primary-dark);
}

.admin-toggle.is-free {
    background: #fff;
    color: var(--text-soft);
}

.admin-muted {
    color: var(--muted);
    font-size: .88rem;
}

.admin-footnote {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.6;
}

.flash {
    margin-bottom: 24px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.flash-success {
    border-color: #a7d7b5;
}

.admin-empty,
.form-card,
.admin-table-wrapper,
.admin-danger-zone {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.admin-empty,
.form-card,
.admin-danger-zone {
    padding: 24px;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 24px;
    align-items: start;
}

.admin-form-sidebar {
    position: sticky;
    top: 24px;
}

.admin-page form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.admin-page form input[type="text"],
.admin-page form textarea,
.admin-page form select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.admin-page form textarea {
    resize: vertical;
}

.admin-page form input:focus,
.admin-page form textarea:focus,
.admin-page form select:focus {
    outline: 2px solid rgba(103, 80, 164, 0.18);
    border-color: var(--primary);
}

.admin-page form > div,
.form-card > div {
    margin-bottom: 18px;
}

.admin-page form ul {
    margin: 6px 0 0;
    padding-left: 20px;
    color: #a12b2b;
}

.admin-submit {
    width: 100%;
    margin-top: 16px;
    border: 0;
    cursor: pointer;
}

.button-danger {
    border: 1px solid #c84b4b;
    background: #fff;
    color: #a12b2b;
    cursor: pointer;
}

.admin-danger-zone {
    margin-top: 32px;
}

.admin-table-wrapper {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.admin-table tbody tr:last-child td {
    border-bottom: 0;
}

.admin-table th {
    color: var(--muted);
    font-size: 0.9rem;
}

.admin-slug {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.85rem;
}

.admin-resource-cell {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 300px;
}

.admin-resource-thumb {
    width: 96px;
    height: 54px;
    flex: 0 0 96px;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.admin-actions {
    white-space: nowrap;
}

.admin-actions a + a {
    margin-left: 12px;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.8rem;
}

.badge-success {
    border-color: #a7d7b5;
}

.badge-premium {
    border-color: #c9b8ef;
}

/* Editor.js */

.content-editor {
    min-height: 280px;
    margin-top: 10px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.content-editor .codex-editor__redactor {
    padding-bottom: 80px !important;
}

.content-editor .ce-block {
    margin: 4px 0;
}

.content-editor .ce-block__content,
.content-editor .ce-toolbar__content {
    max-width: 100%;
}

.content-editor .ce-block--selected .ce-block__content {
    background: #f3f2f7;
}

.content-editor .ce-toolbar__plus,
.content-editor .ce-toolbar__settings-btn {
    border: 1px solid var(--border);
    background: #fff;
}

.content-editor .ce-paragraph,
.content-editor .ce-header {
    min-height: 28px;
}

.editor-callout,
.editor-image,
.editor-document {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafafa;
}

.editor-callout textarea {
    min-height: 90px;
}

.editor-image img {
    display: block;
    max-height: 360px;
    object-fit: contain;
    border-radius: 6px;
}

.editor-image input[type="file"],
.editor-document input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px dashed var(--border);
    border-radius: 7px;
    background: #fff;
}

@media (max-width: 900px) {
    .admin-form-grid {
        grid-template-columns: 1fr;
    }

    .admin-form-sidebar {
        position: static;
    }

    .admin-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* Login */

.account-page { padding: 64px 20px 88px; background: var(--surface-warm); min-height: calc(100vh - 100px); }
.account-card { width: min(600px, 100%); margin: 0 auto; padding: 36px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.account-card h1 { margin: 10px 0 18px; font-size: clamp(1.7rem, 4vw, 2.2rem); line-height: 1.2; }
.account-card p { color: var(--text-soft); line-height: 1.65; }
.account-card form { margin: 28px 0 0; }
.account-card form > div, .account-card form > div > div { margin-bottom: 20px; }
.account-card label { display: block; font-weight: 650; margin: 0 0 7px; }
.account-card input[type="email"], .account-card input[type="password"] { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); font: inherit; }
.account-card input:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.account-card a:focus-visible, .account-card button:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; }
.account-card a:not(.button) { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 3px; }
.account-card form .button { width: 100%; margin-top: 10px; cursor: pointer; font: inherit; }
.account-card .help-text { color: var(--muted); font-size: .85rem; line-height: 1.5; margin-top: 7px; }
.account-card form ul { color: #922727; padding-left: 20px; line-height: 1.5; }
.account-card .login-error { border-color: #d6a0a0; color: #922727; }
.account-card .account-footer { margin: 28px 0 0; padding-top: 24px; border-top: 1px solid var(--border); }
.account-card .account-secondary { font-size: .85rem; margin-bottom: 0; }
.account-forgot { display: block; text-align: right; font-size: .9rem; margin: 0 0 16px; }
.account-details { margin: 28px 0; }
.account-details > div { padding: 16px 0; border-bottom: 1px solid var(--border); }
.account-details dt { color: var(--muted); font-size: .85rem; margin-bottom: 8px; }
.account-details dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.account-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 28px; }
.shared-header .button-header { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 600px) {
    .account-page { padding: 28px 14px 48px; }
    .account-card { padding: 24px 20px; }
    .account-actions { flex-direction: column; align-items: stretch; }
    .account-actions .button { text-align: center; }
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 40px 20px;
}

.login-card {
    width: min(440px, 100%);
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.login-card h1 {
    margin: 28px 0 8px;
}

.login-card > p {
    margin: 0 0 24px;
    color: var(--muted);
}

.login-card form {
    display: grid;
    gap: 18px;
}

.login-card label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.login-card input[type="email"],
.login-card input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font: inherit;
}

.login-card button {
    border: 0;
    cursor: pointer;
}

.login-error {
    border-color: #d6a0a0;
}

/* Written examination guide */
.written-page { background: var(--surface-warm); }
.written-header .brand { font-family: Georgia, serif; font-weight: 700; }
.written-hero { padding: 70px 0; background: linear-gradient(125deg, #faf8fc, #eee4f5); border-bottom: 1px solid var(--border); }
.written-hero h1 { font-size: clamp(2.3rem, 5vw, 4.4rem); line-height: 1.12; margin: 20px 0; }
.written-hero h1 em { color: var(--primary); font-weight: 400; }
.written-intro { max-width: 740px; font-size: 1.15rem; line-height: 1.8; color: var(--text-soft); }
.written-jump { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.written-content { max-width: 1080px; }
.written-content > section, .written-source { margin: 64px 0; scroll-margin-top: 30px; }
.written-content h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); margin: 12px 0 22px; }
.written-content h3 { font-size: 1.6rem; margin: 16px 0; }
.written-content h4 { font-size: 1rem; margin: 24px 0 10px; }
.written-content p, .written-content li { line-height: 1.8; color: var(--text-soft); }
.written-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.written-card { padding: 30px; border: 1px solid var(--border); border-radius: 20px; background: white; box-shadow: var(--shadow); }
.written-card ol { padding-left: 22px; }
.written-card li + li { margin-top: 10px; }
.written-pitfall { border-top: 1px solid var(--border); padding-top: 18px; }
.written-note { padding: 20px 24px; margin-top: 20px; background: var(--surface-soft); border-left: 4px solid var(--primary); border-radius: 0 12px 12px 0; line-height: 1.7; }
.written-table table { width: 100%; border-collapse: collapse; background: white; }
.written-table caption { text-align: left; font-weight: 600; margin: 12px 0; }
.written-table th, .written-table td { text-align: left; padding: 18px; border: 1px solid var(--border); line-height: 1.5; }
.written-table thead { background: var(--surface-soft); }
.written-option { padding-top: 16px; }
.written-source { border-top: 1px solid var(--border); padding-top: 28px; }
.written-source h2 { font-size: 1.4rem; }
.written-source p a { text-decoration: underline; color: var(--primary-dark); }
.written-page a:focus-visible { outline: 3px solid var(--primary); outline-offset: 5px; }
@media (max-width: 700px) {
    .written-grid { grid-template-columns: 1fr; }
    .written-hero { padding: 40px 0; }
    .written-card { padding: 22px; }
    .written-card > .resource-card-image { margin: -22px -22px 22px; border-radius: 19px 19px 0 0; }
    .written-content > section { margin: 42px 0; }
    .written-page .written-header { flex-wrap: wrap; gap: 12px; padding: 14px 0; }
    .written-header .brand { gap: 10px; font-size: .95rem; }
    .written-header nav { width: 100%; justify-content: space-between; }
    .written-table th, .written-table td { padding: 10px 7px; font-size: .85rem; overflow-wrap: anywhere; }
    .written-jump .button { width: 100%; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Shared navigation on every page */
.shared-header .main-nav a[aria-current] { color: var(--primary); text-decoration: underline; text-underline-offset: 6px; }
.shared-header a:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; }
@media (max-width: 1100px) {
    .shared-header > .header-inner { display: flex; flex-wrap: wrap; gap: 12px; padding: 12px 0; }
    .shared-header .main-nav { display: flex; order: 3; width: 100%; margin: 0; flex-wrap: wrap; justify-content: center; gap: 12px 22px; padding: 8px 0; }
    .shared-header .button-header { margin-left: auto; }
}
@media (max-width: 480px) {
    .shared-header .brand { gap: 8px; min-width: 0; flex-shrink: 1; }
    .shared-header .brand-mark { width: 38px; height: 38px; border-radius: 8px; }
    .shared-header .brand-copy strong { font-size: .82rem; }
    .shared-header .brand-copy small { font-size: .5rem; letter-spacing: .06em; }
    .shared-header .button-header { padding: 0 10px; font-size: .75rem; min-height: 36px; }
    .shared-header .main-nav { gap: 12px; }
    .shared-header .main-nav a { font-size: .8rem; }
}
