/* ==========================================================================
   Student account — modern overview page
   Reuses the site's navy/green palette with the newer card layout.
   ========================================================================== */

:root {
    --sa_navy: #0e2a3a;
    --sa_navy_soft: #16394d;
    --sa_green: #2f6b4f;
    --sa_green_soft: #eef7f1;
    --sa_bg: #96a9bf;
    --sa_card: #ffffff;
    --sa_border: #e2e8f0;
    --sa_text: #1f2430;
    --sa_muted: #64748b;
}

body.account_modern {
    margin: 0;
    background: var(--sa_bg);
    color: var(--sa_text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.sa_wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 26px 18px 48px;
}

.sa_head {
    margin-bottom: 20px;
}

.sa_eyebrow {
    margin: 0 0 4px;
    /* Darker green: the page canvas is now mid-tone. */
    color: #143a2a;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.sa_title {
    margin: 0;
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.sa_sub {
    margin: 6px 0 0;
    /* On-canvas secondary text needs more weight than in-card muted text. */
    color: #2f3847;
    font-size: 14px;
}

.sa_card {
    background: var(--sa_card);
    border: 1px solid var(--sa_border);
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.sa_stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.sa_stat {
    padding: 16px 18px;
}

.sa_stat__label {
    margin: 0;
    color: var(--sa_muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sa_stat__value {
    margin: 6px 0 2px;
    color: var(--sa_navy);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
}

.sa_stat__note {
    margin: 0;
    color: var(--sa_muted);
    font-size: 12.5px;
}

.sa_grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    margin-bottom: 18px;
}

.sa_panel {
    padding: 20px;
}

.sa_panel__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.sa_panel__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.sa_panel__meta {
    color: var(--sa_muted);
    font-size: 12.5px;
    font-weight: 600;
}

.sa_next {
    border-left: 4px solid var(--sa_green);
}

.sa_next__when {
    color: var(--sa_navy);
    font-size: 22px;
    font-weight: 700;
}

.sa_next__day {
    margin-top: 2px;
    color: var(--sa_muted);
    font-size: 13.5px;
    font-weight: 600;
}

.sa_next__teacher {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 14px;
    font-weight: 600;
}

.sa_actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 16px;
}

.sa_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: #fff;
    color: var(--sa_text);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.sa_btn--primary {
    background: var(--sa_green);
    border-color: var(--sa_green);
    color: #fff;
}

.sa_btn--primary:hover {
    background: #3f6b4e;
    border-color: #3f6b4e;
}

.sa_btn--ghost {
    border-color: #d7dde5;
    color: var(--sa_text);
}

.sa_btn--ghost:hover {
    background: #f5f8fa;
    border-color: #c3ccd7;
}

.sa_btn--danger {
    border-color: #f0d7d7;
    color: #a12d2d;
    margin: 0;
}

.sa_btn--danger:hover {
    background: #fdf3f3;
}

.sa_empty {
    margin: 0;
    color: var(--sa_muted);
    font-size: 13.5px;
    line-height: 1.6;
}

.sa_empty a {
    color: var(--sa_green);
    font-weight: 700;
}

.sa_profile {
    padding: 20px;
}

.sa_profile__hint {
    margin: 0 0 14px;
    color: var(--sa_muted);
    font-size: 13px;
    line-height: 1.5;
}

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

.sa_field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sa_field--wide {
    grid-column: 1 / -1;
}

.sa_field label {
    color: var(--sa_muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.sa_field input,
.sa_field select,
.sa_field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
    color: var(--sa_text);
    font-family: inherit;
    font-size: 14px;
}

.sa_field textarea {
    min-height: 86px;
    resize: vertical;
}

.sa_field input:focus,
.sa_field select:focus,
.sa_field textarea:focus {
    outline: 2px solid rgba(47, 107, 79, 0.28);
    outline-offset: 1px;
    border-color: var(--sa_green);
}

.sa_form__foot {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sa_saved {
    margin: 0;
    padding: 7px 10px;
    border: 1px solid #d6e8dd;
    border-radius: 8px;
    background: var(--sa_green_soft);
    color: #2f5c40;
    font-size: 12.5px;
    font-weight: 700;
}

.sa_footer {
    margin-top: 26px;
    text-align: center;
    font-size: 12px;
}

.sa_footer a {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

@media (max-width: 860px) {
    .sa_grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .sa_wrap {
        padding: 18px 12px 36px;
    }

    .sa_title {
        font-size: 23px;
    }

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

    .sa_actions .sa_btn {
        flex: 1 1 auto;
    }
}

/* ---- account sub-page navigation ---------------------------------------- */

.sa_tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 20px;
}

.sa_tab {
    padding: 8px 13px;
    border: 1px solid var(--sa_border);
    border-radius: 999px;
    background: #fff;
    color: var(--sa_muted);
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
}

.sa_tab:hover {
    border-color: #bcd8c7;
    color: var(--sa_green);
}

.sa_tab.is-active {
    background: var(--sa_navy);
    border-color: var(--sa_navy);
    color: #fff;
}

/* css.css hides every link inside a <nav> at <=800px for the old mobile menu.
   That also hides the account tabs on phones, so restore them here. */
@media only screen and (max-width: 800px) {
    .sa_tabs a.sa_tab {
        display: block;
    }
}

/* ---- lesson lists ------------------------------------------------------- */

.sa_lessons {
    display: grid;
    gap: 12px;
}

.sa_lesson {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px 18px;
    border: 1px solid var(--sa_border);
    border-radius: 14px;
    background: #fff;
}

.sa_lesson--live {
    border-color: #bcd8c7;
    background: var(--sa_green_soft);
}

.sa_lesson__time {
    color: var(--sa_navy);
    font-size: 19px;
    font-weight: 700;
}

.sa_lesson__date {
    margin-top: 2px;
    color: var(--sa_muted);
    font-size: 12.5px;
    font-weight: 600;
}

.sa_lesson__name {
    font-size: 14.5px;
    font-weight: 700;
}

.sa_lesson__sub {
    margin-top: 2px;
    color: var(--sa_muted);
    font-size: 12.5px;
}

.sa_lesson__book {
    margin-top: 3px;
    color: #334155;
    font-size: 12.5px;
    font-weight: 600;
}

.sa_lesson__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.sa_pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.sa_pill--booked {
    background: #e6edf4;
    color: #0e2a3a;
}

.sa_pill--live {
    background: var(--sa_green);
    color: #fff;
}

.sa_pill--done {
    background: var(--sa_green_soft);
    color: #3f6b4e;
}

.sa_report {
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid var(--sa_border);
    border-radius: 10px;
    background: #f8fafc;
}

.sa_report h4 {
    margin: 10px 0 2px;
    color: var(--sa_muted);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sa_report h4:first-child {
    margin-top: 0;
}

.sa_report p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: #33404f;
    white-space: pre-line;
}

/* ---- tables ------------------------------------------------------------- */

.sa_table_wrap {
    overflow-x: auto;
}

.sa_table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.sa_table th {
    padding: 8px 10px;
    border-bottom: 1px solid var(--sa_border);
    color: var(--sa_muted);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.sa_table td {
    padding: 10px;
    border-bottom: 1px solid #f1f4f8;
    vertical-align: top;
}

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

.sa_table .sa_num {
    text-align: right;
    white-space: nowrap;
}

.sa_plan {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.sa_plan__main {
    flex: 1 1 240px;
}

.sa_plan__name {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.sa_plan__meta {
    margin: 4px 0 0;
    color: var(--sa_muted);
    font-size: 13px;
}

.sa_plan__price {
    color: var(--sa_navy);
    font-size: 24px;
    font-weight: 800;
}

.sa_plan__price small {
    color: var(--sa_muted);
    font-size: 12px;
    font-weight: 600;
}

.sa_update_box {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f4f8;
}

.sa_meta_note {
    margin: 10px 0 0;
    color: var(--sa_muted);
    font-size: 12.5px;
}

@media (max-width: 700px) {
    .sa_lesson {
        grid-template-columns: 1fr;
    }

    .sa_lesson__actions {
        justify-content: flex-start;
    }
}

.subscription-flash {
    animation: subscriptionFlash 1.1s ease;
}

@keyframes subscriptionFlash {
    0% {
        box-shadow: 0 0 0 3px rgba(91, 140, 106, 0.55);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(91, 140, 106, 0);
    }
}

/* Teacher welcome message modal */
.sa_modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.sa_modal[hidden] {
    display: none;
}

.sa_modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.sa_modal__card {
    position: relative;
    width: min(92vw, 480px);
    max-height: 80vh;
    overflow: auto;
    padding: 22px;
    background: var(--sa_card);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.28);
    color: var(--sa_text);
}

.sa_modal__title {
    margin: 0 0 4px;
    font-size: 18px;
    line-height: 1.3;
}

.sa_modal__teacher {
    margin: 0 0 14px;
    color: var(--sa_muted);
    font-size: 13px;
    font-weight: 600;
}

.sa_modal__body {
    margin: 0 0 18px;
    font-size: 14.5px;
    line-height: 1.7;
    white-space: pre-wrap;
}

.sa_modal__actions {
    display: flex;
    justify-content: flex-end;
}

body.sa_modal_open {
    overflow: hidden;
}

.sa_message_source {
    display: none;
}

/* Expandable lesson phrases in the completed-lessons list */
.sa_lesson__more {
    grid-column: 1 / -1;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--sa_border);
}

.sa_phrase_toggle {
    width: auto;
    gap: 6px;
    list-style: none;
    cursor: pointer;
}

.sa_phrase_toggle::-webkit-details-marker {
    display: none;
}

.sa_phrase_toggle::after {
    content: "\25BE";
    font-size: 10px;
}

.sa_lesson__more[open] .sa_phrase_toggle::after {
    content: "\25B4";
}

.sa_phrase_list {
    margin: 10px 0 0;
    padding-left: 20px;
    color: var(--sa_text);
    font-size: 13.5px;
    line-height: 1.75;
}
