/* ==========================================================================
   Design tokens and global foundation
   ========================================================================== */
:root {
    --green: #648276;
    --dark: #263a34;
    --cream: #f5f2ec;
    --card: #fff;
    --accent: #c98262;
    --line: #dfe5e1;
    --danger: #a84d4d;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--cream);
    color: var(--dark);
    font: 16px/1.5 system-ui, -apple-system, Segoe UI, sans-serif;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px clamp(16px, 5vw, 64px);
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 5;
}

.brand {
    font-size: 1.25rem;
    color: var(--dark);
    text-decoration: none;
}

nav {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}

nav a,
.link {
    color: var(--dark);
    text-decoration: none;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
}

main {
    max-width: 1250px;
    margin: auto;
    padding: 32px clamp(16px, 4vw, 48px) 70px;
}

.hero {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 40px;
    align-items: center;
    min-height: 70vh;
}

.hero h1 {
    font-size: clamp(2.3rem, 6vw, 5rem);
    line-height: 1.02;
    margin: .2em 0;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--green);
    font-weight: 700;
    font-size: .8rem;
}

/* ==========================================================================
   Reusable layout and card components
   ========================================================================== */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 10px 30px rgba(38, 58, 52, .06);
}

.login {
    max-width: 430px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.grid.two {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.narrow {
    max-width: 650px;
}

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

.pagehead h1 {
    margin: .1em 0;
    font-size: clamp(2rem, 4vw, 3.3rem);
}

h2 {
    margin-top: 34px;
}

/* ==========================================================================
   Forms and controls
   ========================================================================== */
form {
    margin: 0;
}

label {
    display: block;
    font-weight: 650;
    margin-bottom: 15px;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 13px;
    margin-top: 6px;
    border: 1px solid #cbd5d0;
    border-radius: 10px;
    background: #fff;
    font: inherit;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    padding: 11px 16px;
    background: var(--green);
    color: white;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

.secondary {
    background: #e8eeeb !important;
    color: var(--dark) !important;
}

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

.actions,
.inline {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.inline select {
    width: auto;
    flex: 1;
    min-width: 150px;
}

.formgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
}

/* ==========================================================================
   Status messages, badges and tables
   ========================================================================== */
.flash {
    padding: 14px 18px;
    border-radius: 12px;
    background: #e8eeeb;
    margin-bottom: 20px;
}

.flash.error {
    background: #f7dddd;
}

.flash.success {
    background: #dcefe4;
}

.flash.warning {
    background: #fff1cc;
}

.badge {
    display: inline-block;
    padding: 4px 9px;
    background: #e8eeeb;
    border-radius: 99px;
    font-size: .8rem;
}

.badge.waitlist {
    background: #fff1cc;
}

.coursehead {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.course h3 {
    margin: .2em 0;
}

.course ul {
    list-style: none;
    padding: 0;
}

.course li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    padding: 8px 0;
}

.icon {
    padding: 2px 9px;
    background: transparent;
    color: var(--danger);
    font-size: 1.25rem;
}

.people {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin: 14px 0;
}

.stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.stats span {
    background: #fff;
    border: 1px solid var(--line);
    padding: 8px 12px;
    border-radius: 99px;
}

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

th,
td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--line);
}

pre {
    white-space: pre-wrap;
    background: #f7f7f5;
    padding: 12px;
    border-radius: 10px;
}

.muted,
small {
    color: #65736e;
}

details {
    margin-top: 14px;
}

summary {
    cursor: pointer;
    font-weight: 700;
}

/* ==========================================================================
   Responsive base layout
   ========================================================================== */
@media(max-width:800px) {
    header {
        position: static;
        align-items: flex-start;
        flex-direction: column;
    }

    .hero,
    .grid.two {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
    }

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

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

    .cards.schedule {
        grid-template-columns: 1fr;
    }

    table,
    tbody,
    tr,
    td {
        display: block;
    }

    th {
        display: none;
    }

    td {
        padding: 7px 0;
    }

    .inline button {
        flex: none;
    }
}

@media(max-width:480px) {
    main {
        padding-top: 22px;
    }

    .card {
        padding: 17px;
        border-radius: 14px;
    }

    nav {
        gap: 12px;
        font-size: .92rem;
    }

    .actions form,
    .actions button {
        width: 100%;
    }

    .inline {
        align-items: stretch;
        flex-direction: column;
    }

    .inline select {
        width: 100%;
    }
}

/* ==========================================================================
   Admin schedule and drag-and-drop planner
   ========================================================================== */
.planner-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    align-items: start;
}

.participant-pool {
    position: sticky;
    top: 95px;
}

.series-list {
    min-width: 0;
}

.series-card>summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.session-row {
    border-top: 1px solid var(--line);
    padding: 18px 0;
}

.session-main {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.dropzone {
    border: 2px dashed #bdcbc5;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    margin: 10px 0;
}

.dropzone.over {
    background: #dcefe4;
    border-color: var(--green);
}

.drag-person {
    padding: 11px;
    border-bottom: 1px solid var(--line);
    cursor: grab;
}

.drag-person small {
    display: block;
}

.booking-list {
    list-style: none;
    padding: 0;
}

.booking-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding: 8px 0;
}

.booking-list form {
    margin-left: auto;
}

.booking-name {
    min-width: 0;
}

.pending-confirmation {
    display: block;
    color: #a16626;
}

.credential-card {
    margin-top: 18px;
}

.compact-bookings {
    display: grid;
    gap: 14px;
}

.booking-card>div {
    display: flex;
    justify-content: space-between;
}

.booking-card details {
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.series-overview p {
    margin: .4rem 0;
}

.cancelled {
    opacity: .72;
}

.danger-badge {
    background: #f7dddd;
    color: var(--danger);
}

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

    .participant-pool {
        position: static;
    }
}

/* ==========================================================================
   Registration and participant pages
   ========================================================================== */
.registration-success {
    max-width: 780px;
    margin: 0 auto;
}

.process-highlight {
    background: #edf5f0;
    border-left: 5px solid var(--green);
    border-radius: 12px;
    padding: 18px 20px;
    margin: 16px 0;
}

.process-highlight p:last-child {
    margin-bottom: 0;
}

/* V2.5 */
/* ==========================================================================
   Series assignment, alternatives and attendance
   ========================================================================== */
.series-summary-stats {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.series-assignment {
    margin-top: 18px;
    padding: 16px;
    border-radius: 14px;
    background: #f3f7f4;
    border: 1px solid var(--line);
}

.series-assignment h3 {
    margin: 0 0 10px;
}

.series-members {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.series-member {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border: 1px solid var(--line);
    border-radius: 99px;
    background: #fff;
    padding: 4px 5px 4px 12px;
}

.series-member form {
    display: inline-flex;
}

.series-member .icon {
    font-size: 1.05rem;
}

.alternative-actions {
    margin-top: 14px;
}

.cancel-booking-form {
    margin-top: 12px;
}

.confirmation-form {
    margin-top: 14px;
}

.archive-form {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.attendance-card table+form {
    margin-top: 28px;
}

.session-row:target {
    scroll-margin-top: 100px;
    outline: 3px solid rgba(100, 130, 118, .25);
}

/* ==========================================================================
   Capacity and waiting-list states
   ========================================================================== */
.capacity-warning,
.waitlist-highlight {
    border-left: 4px solid #c98262;
    padding-left: 1rem;
}

.stacked-form {
    display: grid;
    gap: .7rem;
    margin: 1rem 0;
}

.alternative-register-form {
    display: grid;
    gap: .8rem;
    margin-top: 1rem;
    max-width: 720px;
}
