/* =============================================================================
   SUMMIT RECALL — High-Yield Quizzes
   Self-contained styles. Brand tokens + app-bar mirror the math app; the rest
   are Recall-specific components.
   ============================================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --teal-primary: #2C5F7C;
    --teal-light: #3D5A80;
    --terracotta: #C1704F;
    --sage: #8B9E7D;
    --cream: #F7F3ED;
    --warm-white: #FAF8F5;
    --charcoal: #2B2D42;
    --light-blue: #E8F1F5;
    --green: #4F8A5B;
    --green-bg: #E7F2E9;
    --red: #B0472A;
    --red-bg: #FBE9E3;
    --rule: #E5DDD2;
    --heading-font: 'Manrope', sans-serif;
    --body-font: 'Inter', sans-serif;
    --accent-font: 'Crimson Pro', serif;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 16px;
    --shadow-sm: 0 2px 8px rgba(44, 95, 124, 0.06);
    --shadow-md: 0 4px 20px rgba(44, 95, 124, 0.08);
    --shadow-lg: 0 8px 32px rgba(44, 95, 124, 0.1);
    --bar-height: 60px;
}

body {
    font-family: var(--body-font);
    background-color: var(--cream);
    background-image: url("mountain-wash.svg");
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: 100% auto;
    background-attachment: fixed;
    color: var(--charcoal);
    line-height: 1.6;
    padding-top: var(--bar-height);
}

/* ---- app bar (mirrors math) ---------------------------------------------- */
.app-bar {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--bar-height); z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid rgba(44, 95, 124, 0.10);
}
.app-bar-inner {
    max-width: 880px; height: 100%; margin: 0 auto; padding: 0 16px;
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 8px; justify-self: start; user-select: none; text-decoration: none; grid-column: 1; }
.brand-logo { height: 40px; width: 40px; object-fit: contain; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--heading-font); font-weight: 800; font-size: 0.95rem; color: var(--teal-primary); letter-spacing: -0.4px; }
.brand-tagline { font-family: var(--body-font); font-weight: 500; font-size: 0.58rem; color: var(--teal-light); letter-spacing: 0.4px; opacity: 0.7; margin-top: 3px; }
.app-bar-section {
    font-family: var(--heading-font); font-weight: 700; font-size: 0.78rem;
    text-transform: uppercase; letter-spacing: 1.6px; color: var(--teal-light);
    justify-self: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.app-bar-actions { display: flex; gap: 0; align-items: center; justify-self: end; grid-column: 3; }
.bar-btn {
    display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 8px;
    border: none; background: transparent; border-radius: 999px;
    font-family: var(--body-font); font-size: 0.82rem; font-weight: 600;
    color: var(--teal-primary); cursor: pointer; text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.bar-btn:hover { background: var(--light-blue); }
.bar-btn:active { transform: translateY(0.5px); }
.bar-btn .bar-btn-icon { font-size: 1.2rem; line-height: 1; }

/* ---- container ----------------------------------------------------------- */
.container { max-width: 880px; margin: 0 auto; padding: 24px 16px 80px; }

.page-title { text-align: center; margin: 8px 0 28px; }
.page-title h1 {
    font-family: var(--heading-font); font-weight: 800; font-size: 2rem; letter-spacing: -0.6px;
    background: linear-gradient(120deg, var(--teal-primary), var(--teal-light));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.page-title p { color: var(--teal-light); font-size: 1rem; margin-top: 6px; }

/* ---- hub topic cards ----------------------------------------------------- */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.topic-card {
    display: block; text-decoration: none; color: inherit; background: var(--warm-white);
    border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 22px 20px;
    box-shadow: var(--shadow-sm); transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.topic-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--teal-primary); }
.topic-card-emoji { font-size: 1.7rem; }
.topic-card h3 { font-family: var(--heading-font); font-weight: 800; font-size: 1.2rem; margin: 10px 0 4px; color: var(--teal-primary); }
.topic-card p { font-size: 0.9rem; color: var(--charcoal); opacity: 0.8; }
.topic-card-meta { margin-top: 12px; font-size: 0.8rem; font-weight: 600; color: var(--teal-light); }
.topic-card.is-soon { opacity: 0.6; pointer-events: none; }
.topic-card.is-soon .topic-card-meta { color: var(--terracotta); }

/* ---- setup screen -------------------------------------------------------- */
.rc-setup { max-width: 620px; margin: 0 auto; }
.rc-page-title {
    font-family: var(--heading-font); font-weight: 800; font-size: 1.9rem; letter-spacing: -0.5px;
    text-align: center;
    background: linear-gradient(120deg, var(--teal-primary), var(--teal-light));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.rc-page-sub { text-align: center; color: var(--teal-light); margin: 6px 0 24px; }

.rc-setup-block {
    background: var(--warm-white); border: 1px solid var(--rule);
    border-radius: var(--radius-md); padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.rc-setup-head {
    display: flex; justify-content: space-between; align-items: baseline;
    font-family: var(--heading-font); font-weight: 700; font-size: 0.95rem; color: var(--teal-primary);
    margin-bottom: 12px;
}
.rc-setup-tools { font-family: var(--body-font); font-weight: 500; font-size: 0.82rem; }
.rc-setup-tools a { color: var(--teal-light); text-decoration: none; }
.rc-setup-tools a:hover { text-decoration: underline; }
.rc-setup-sub { font-family: var(--body-font); font-weight: 400; font-size: 0.82rem; color: var(--teal-light); opacity: 0.8; }

/* facet pickers (Show me / Ask me to recall) */
.rc-facet-row { display: flex; gap: 8px; flex-wrap: wrap; }
.rc-facet-pill {
    font-family: var(--body-font); font-size: 0.9rem; font-weight: 600;
    padding: 9px 18px; border: 1px solid var(--rule); border-radius: 999px;
    background: #fff; color: var(--teal-primary); cursor: pointer; transition: all 0.12s;
}
.rc-facet-pill:hover { border-color: var(--teal-primary); }
.rc-facet-pill.is-on { background: var(--teal-primary); color: #fff; border-color: var(--teal-primary); }

/* live "which angles will I get" summary */
.rc-angle-summary {
    margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius-md);
    background: var(--light-blue); font-size: 0.85rem; line-height: 1.9;
}
.rc-angle-empty { color: var(--teal-light); font-style: italic; }
.rc-angle-count { font-weight: 700; color: var(--teal-primary); margin-right: 4px; }
.rc-angle-tag {
    display: inline-block; background: #fff; color: var(--teal-primary);
    border: 1px solid rgba(44,95,124,0.2); border-radius: 999px;
    padding: 2px 10px; margin: 0 4px 4px 0; font-size: 0.78rem; font-weight: 600; white-space: nowrap;
}

.rc-filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.rc-filter-toggle {
    font-family: var(--body-font); font-size: 0.85rem; font-weight: 600;
    padding: 7px 16px; border: 1px solid var(--rule); border-radius: 999px;
    background: #fff; color: var(--teal-light); cursor: pointer; transition: all 0.12s;
}
.rc-filter-toggle.is-on { background: var(--teal-primary); color: #fff; border-color: var(--teal-primary); }

.rc-count-row { display: flex; align-items: center; gap: 12px; }
.rc-count-input {
    width: 90px; padding: 9px 12px; border: 1px solid var(--rule); border-radius: var(--radius-sm);
    font-family: var(--body-font); font-size: 1rem; color: var(--charcoal);
}
.rc-count-avail { font-size: 0.85rem; color: var(--teal-light); }
.rc-count-avail a { color: var(--teal-primary); }

.rc-start-btn {
    width: 100%; padding: 14px; margin-top: 8px; border: none; border-radius: var(--radius-md);
    background: var(--teal-primary); color: #fff; font-family: var(--heading-font);
    font-weight: 700; font-size: 1.05rem; cursor: pointer; transition: background 0.15s, transform 0.05s;
}
.rc-start-btn:hover { background: var(--teal-light); }
.rc-start-btn:active { transform: translateY(1px); }
.rc-start-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---- quiz ---------------------------------------------------------------- */
.rc-quiz { max-width: 620px; margin: 0 auto; }
.rc-quiz-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.rc-link { background: none; border: none; color: var(--teal-primary); font-family: var(--body-font); font-weight: 600; font-size: 0.9rem; cursor: pointer; }
.rc-quiz-progress { font-weight: 600; color: var(--teal-light); font-size: 0.9rem; }
.rc-quiz-score { margin-left: 12px; color: var(--charcoal); opacity: 0.7; }

.rc-card {
    background: var(--warm-white); border: 1px solid var(--rule); border-radius: var(--radius-lg);
    padding: 24px; box-shadow: var(--shadow-md);
}
.rc-mode-tag {
    display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; color: var(--teal-light); background: var(--light-blue);
    padding: 3px 12px; border-radius: 999px; margin-bottom: 16px;
}
.rc-prompt { display: flex; align-items: center; justify-content: center; min-height: 80px; margin-bottom: 18px; }
.rc-prompt-structure { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius-md); padding: 12px; }
.rc-prompt-value { font-family: var(--heading-font); font-weight: 800; font-size: 1.8rem; color: var(--teal-primary); text-align: center; }

/* typed answer */
.rc-typed { display: flex; gap: 10px; }
.rc-input {
    flex: 1; padding: 13px 16px; border: 2px solid var(--rule); border-radius: var(--radius-md);
    font-family: var(--body-font); font-size: 1.1rem; color: var(--charcoal); outline: none;
    transition: border-color 0.12s;
}
.rc-input:focus { border-color: var(--teal-primary); }
.rc-input:disabled { background: #f3efe8; }
/* Remove Safari/WebKit's contacts & credentials autofill button (the icon that
   triggers the contact dropdown). Deterministic suppressor, independent of heuristics. */
.rc-input::-webkit-contacts-auto-fill-button,
.rc-input::-webkit-credentials-auto-fill-button {
    visibility: hidden !important;
    display: none !important;
    pointer-events: none;
    position: absolute;
    right: 0;
}
.rc-submit {
    padding: 0 22px; border: none; border-radius: var(--radius-md); background: var(--teal-primary);
    color: #fff; font-family: var(--heading-font); font-weight: 700; font-size: 1rem; cursor: pointer;
}
.rc-submit:hover { background: var(--teal-light); }
.rc-submit:disabled { opacity: 0.45; cursor: not-allowed; }

/* mcq pick-the-structure */
.rc-mcq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rc-mcq-choice {
    background: #fff; border: 2px solid var(--rule); border-radius: var(--radius-md);
    padding: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    min-height: 130px; transition: border-color 0.12s, box-shadow 0.12s;
}
.rc-mcq-choice:hover:not(:disabled) { border-color: var(--teal-primary); box-shadow: var(--shadow-sm); }
.rc-mcq-choice.is-correct { border-color: var(--green); background: var(--green-bg); }
.rc-mcq-choice.is-wrong { border-color: var(--red); background: var(--red-bg); }
.rc-mcq-struct { width: 100%; display: flex; align-items: center; justify-content: center; }

.rc-struct-missing { font-size: 0.8rem; color: var(--teal-light); font-style: italic; }

/* pick-the-text MCQ (e.g. classification) */
.rc-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rc-choice-btn {
    padding: 16px; border: 2px solid var(--rule); border-radius: var(--radius-md);
    background: #fff; font-family: var(--heading-font); font-weight: 700; font-size: 1.05rem;
    color: var(--teal-primary); cursor: pointer; transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}
.rc-choice-btn:hover:not(:disabled) { border-color: var(--teal-primary); box-shadow: var(--shadow-sm); }
.rc-choice-btn.is-correct { border-color: var(--green); background: var(--green-bg); color: var(--green); }
.rc-choice-btn.is-wrong { border-color: var(--red); background: var(--red-bg); color: var(--red); }

/* feedback */
.rc-feedback { display: none; margin-top: 18px; }
.rc-feedback.is-shown { display: block; }
.rc-verdict { font-family: var(--heading-font); font-weight: 800; font-size: 1.1rem; margin-bottom: 8px; }
.rc-verdict.is-correct { color: var(--green); }
.rc-verdict.is-wrong { color: var(--red); }
.rc-near { font-size: 0.88rem; color: var(--terracotta); margin-bottom: 8px; }
.rc-answer-key {
    background: var(--cream); border: 1px solid var(--rule); border-radius: var(--radius-md);
    padding: 12px 16px; font-size: 1rem;
}
.rc-answer-key .rc-note { font-size: 0.85rem; color: var(--teal-light); margin-top: 6px; }
.rc-next {
    width: 100%; margin-top: 16px; padding: 13px; border: none; border-radius: var(--radius-md);
    background: var(--teal-primary); color: #fff; font-family: var(--heading-font);
    font-weight: 700; font-size: 1rem; cursor: pointer;
}
.rc-next:hover { background: var(--teal-light); }

/* ---- results ------------------------------------------------------------- */
.rc-results { max-width: 560px; margin: 0 auto; text-align: center; }
.rc-score-ring {
    width: 120px; height: 120px; border-radius: 50%; margin: 8px auto 16px;
    display: flex; align-items: center; justify-content: center;
    background: conic-gradient(var(--teal-primary) calc(var(--p, 0) * 1%), var(--rule) 0);
    --p: 0;
}
.rc-score-ring span {
    width: 92px; height: 92px; border-radius: 50%; background: var(--warm-white);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--heading-font); font-weight: 800; font-size: 1.5rem; color: var(--teal-primary);
}
.rc-results-line { font-family: var(--heading-font); font-weight: 800; font-size: 1.4rem; color: var(--charcoal); }
.rc-results-msg { color: var(--teal-light); margin: 6px 0 20px; }
.rc-results-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }
.rc-results-actions .rc-start-btn { width: auto; padding: 12px 24px; margin: 0; }
.rc-link-btn {
    padding: 12px 20px; border: 1px solid var(--rule); border-radius: var(--radius-md);
    background: #fff; color: var(--teal-primary); font-family: var(--heading-font);
    font-weight: 700; font-size: 0.95rem; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center;
}
.rc-link-btn:hover { border-color: var(--teal-primary); }

.rc-review-head {
    text-align: left; font-family: var(--heading-font); font-weight: 700;
    font-size: 0.95rem; color: var(--teal-primary); margin: 4px 0 10px;
}
.rc-review-perfect { color: var(--green); }
.rc-review { list-style: none; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.rc-review-item {
    background: var(--warm-white); border: 1px solid var(--rule); border-radius: var(--radius-sm); font-size: 0.92rem;
}
.rc-review-item.ok { display: flex; align-items: center; gap: 12px; padding: 9px 14px; }
.rc-review-item.ok .rc-review-mark { color: var(--green); }
.rc-review-mark { font-weight: 800; }
.rc-review-name { font-weight: 600; flex: 1; }
.rc-review-mode { font-size: 0.78rem; color: var(--teal-light); }

/* missed-question expanded detail */
.rc-review-missed { padding: 0; overflow: hidden; }
.rc-review-missed .rc-review-row {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px;
    border-bottom: 1px solid var(--rule); background: rgba(176, 71, 42, 0.04);
}
.rc-review-missed .rc-review-mark { color: var(--red); }
.rc-rd-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px; background: var(--rule); }
.rc-rd-cell { background: var(--warm-white); padding: 10px 12px; min-height: 90px; }
.rc-rd-label {
    font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--teal-light); margin-bottom: 6px;
}
.rc-rd-value { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.rc-rd-text { font-weight: 600; font-size: 0.95rem; }
.rc-rd-sub { font-size: 0.75rem; color: var(--teal-light); }
.rc-rd-wrong .rc-rd-text { color: var(--red); }
.rc-rd-right .rc-rd-text { color: var(--green); }
.rc-rd-right .rc-rd-label { color: var(--green); }
.rc-rd-wrong .rc-rd-label { color: var(--red); }
.rc-rd-struct { display: flex; align-items: center; justify-content: flex-start; }

@media (max-width: 600px) {
    .rc-rd-grid { grid-template-columns: 1fr; }
    .rc-rd-cell { min-height: 0; }
}

/* ---- mobile -------------------------------------------------------------- */
@media (max-width: 600px) {
    :root { --bar-height: 56px; }
    .app-bar-section { display: none; }
    .bar-btn-label { display: none; }
    .page-title h1, .rc-page-title { font-size: 1.6rem; }
    .rc-card { padding: 18px; }
    .rc-typed { flex-direction: column; }
    .rc-submit { padding: 12px; }
    .rc-prompt-value { font-size: 1.5rem; }
}
