/* ============================================
   BASE
   ============================================ */

body {
    font-family: system-ui, sans-serif;
    color: #0a0c0b;
    background: #cfd2d8;
    line-height: 1.6;
    max-width: 820px;
    margin: 0 auto;
    padding: 70px 30px;
}

h1 {
    font-size: 40px;
    margin-bottom: 8px;
}

/* ============================================
   LANDING PAGE CARDS
   ============================================ */

.cards {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.card {
    flex: 1;
    min-width: 240px;
    background: rgb(214, 203, 203);
    border: 1px solid #075be2;
    border-radius: 14px;
    padding: 32px 24px;
}

.card a {
    display: inline-block;
    margin-top: 8px;
    padding: 12px 24px;
    color: rgb(7, 3, 3);
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
}

.clinical a {
    background: #0e9f6e;
}

.educational a {
    background: #0e9f6e;
}

/* ============================================
   FORMS (login / signup)
   ============================================ */

form {
    display: flex;
    flex-direction: column;
    max-width: 380px;
    background: white;
    border: 1px solid #e3e6eb;
    border-radius: 14px;
    padding: 32px;
}

label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
}

input,
select {
    font-size: 16px;
    font-family: inherit;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #cfd4dc;
    border-radius: 8px;
}

input:focus {
    outline: none;
    border-color: #0e9f6e;
}

form button {
    font-size: 16px;
    font-family: inherit;
    font-weight: 600;
    color: white;
    background: #0e9f6e;
    border: none;
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
}

/* ============================================
   SESSION SCREEN — LAYOUT
   ============================================ */

.session-layout {
    display: flex;
    flex-direction: row-reverse;
    gap: 24px;
    align-items: flex-start;
}

.session-main {
    flex: 1;
}

.side-panel {
    width: 200px;
    flex-shrink: 0;
    background: white;
    border-radius: 14px;
    padding: 20px;
}

.side-panel ul {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
}

.side-panel a {
    display: block;
    padding: 10px 8px;
    color: #14181f;
    text-decoration: none;
    border-radius: 8px;
}

/* Collapsible panel headings */
.panel-heading {
    display: block;
    width: 100%;
    text-align: left;
    font-size: 15px;
    font-family: inherit;
    font-weight: 600;
    text-transform: uppercase;
    color: #5b6573;
    background: none;
    border: none;
    padding: 8px 0;
    cursor: pointer;
}

.target-list.collapsed,
.behavior-list.collapsed {
    display: none;
}

/* ============================================
   SESSION TIMER CARD
   ============================================ */

.session-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border: 1px solid #e3e6eb;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.session-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.session-ring {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

.ring-track {
    fill: none;
    stroke: #e3e6eb;
    stroke-width: 3;
}

.ring-fill {
    fill: none;
    stroke: #0e9f6e;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 151;
    stroke-dashoffset: 151;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 0.5s linear;
}

.ring-dot {
    fill: #0e9f6e;
}

.session-label {
    font-size: 11px;
    letter-spacing: 0.6px;
    color: #8a93a2;
    margin: 0;
}

.session-clock {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 32px;
    font-weight: 600;
    letter-spacing: 2px;
    margin: 1px 0 0 0;
    font-variant-numeric: tabular-nums;
}

.session-meta {
    font-size: 11px;
    color: #8a93a2;
    margin: 2px 0 0 0;
}

.session-buttons {
    display: flex;
    gap: 8px;
}

#startSessionBtn {
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    color: #0e9f6e;
    background: #e8f6f1;
    border: 1px solid #0e9f6e;
    border-radius: 20px;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

#startSessionBtn:hover {
    background: #0e9f6e;
    color: white;
}

#endBtn {
    display: none;
    font-size: 13px;
    font-family: inherit;
    color: #8a93a2;
    background: transparent;
    border: 1px solid #cfd4dc;
    border-radius: 20px;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

#endBtn:hover {
    background: #c0392b;
    border-color: #c0392b;
    color: white;
}

/* ============================================
   SESSION SCREEN — TEXT
   ============================================ */

.target-name {
    font-size: 34px;
    margin: 8px 0 4px 0;
}

.trial-count {
    font-size: 18px;
    color: #5b6573;
    margin: 0;
}

.score {
    font-size: 22px;
    margin: 16px 0 28px 0;
}

.pct {
    font-size: 44px;
    font-weight: 700;
}

/* ============================================
   SESSION SCREEN — BUTTONS
   ============================================ */

.responses {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.responses button {
    font-size: 24px;
    font-family: inherit;
    font-weight: 600;
    color: white;
    border: none;
    border-radius: 16px;
    padding: 32px;
    cursor: pointer;
}

.btn-independent {
    background: #0e9f6e;
}

.btn-prompted {
    background: #d9840d;
}

.btn-incorrect {
    background: #c0392b;
}

.session-controls {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

.btn-secondary {
    flex: 1;
    font-size: 14px;
    font-family: inherit;
    background: none;
    color: #5b6573;
    border: 1px solid #b9bfc9;
    border-radius: 10px;
    padding: 10px 8px;
    white-space: nowrap;
    cursor: pointer;
}

.btn-behavior {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 15px;
    font-family: inherit;
    text-align: left;
    padding: 12px 10px;
    background: white;
    border: 1px solid #cfd4dc;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 6px;
}

/* ============================================
   ADD SKILL / BEHAVIOR
   ============================================ */

.add-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e3e6eb;
}

.add-item input {
    width: 100%;
    box-sizing: border-box;
    font-size: 14px;
    padding: 8px 10px;
    margin-bottom: 0;
}

.add-item button {
    font-size: 14px;
    font-family: inherit;
    padding: 8px;
    background: #eef0f3;
    border: 1px solid #cfd4dc;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 12px;
}

/* ============================================
   LOCKED STATE
   ============================================ */

body.locked .responses button,
body.locked .btn-behavior,
body.locked .session-controls button {
    opacity: 0.4;
}

body.locked #lockBtn {
    opacity: 1;
    background: #c0392b;
    color: white;
    border-color: #c0392b;
}

/* Panel toggles: hidden on desktop, shown on phones */
.panel-toggle {
    display: none;
}

.side-toggle {
    display: none;
}

/* ============================================
   PHONE LAYOUT (700px and narrower)
   ============================================ */

@media (max-width: 700px) {

    body {
        padding: 20px 16px;
    }

    .target-name {
        font-size: 26px;
    }

    .panel-toggle {
        display: block;
        position: fixed;
        top: 60px;
        right: 12px;
        z-index: 20;
        font-size: 20px;
        padding: 8px 14px;
        background: white;
        border: 1px solid #cfd4dc;
        border-radius: 10px;
        cursor: pointer;
    }

    .side-toggle {
        display: block;
        position: fixed;
        top: 60px;
        right: 76px;
        z-index: 20;
        font-size: 16px;
        padding: 8px 12px;
        background: white;
        border: 1px solid #cfd4dc;
        border-radius: 10px;
        cursor: pointer;
    }

    /* Panel slides in from the right, over the content */
    .side-panel {
        position: fixed;
        top: 0;
        right: 0;
        width: 80%;
        max-width: 320px;
        height: 100%;
        background: white;
        overflow-y: auto;
        overscroll-behavior: contain;
        z-index: 15;
        padding: 60px 20px 20px;
        border-radius: 0;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
        transform: translateX(100%);
        transition: transform 0.25s ease;
    }

    .side-panel.open {
        transform: translateX(0);
    }

    /* Stop the page behind scrolling while the panel is open */
    body.panel-open {
        overflow: hidden;
    }

    /* Dim the background while the panel is open */
    body.panel-open::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.3);
        z-index: 14;
    }

    /* Left-handed mode: flip the buttons and the panel to the left */
    body.left-handed .panel-toggle {
        right: auto;
        left: 12px;
    }

    body.left-handed .side-toggle {
        right: auto;
        left: 76px;
    }

    body.left-handed .side-panel {
        right: auto;
        left: 0;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
        transform: translateX(-100%);
    }

    body.left-handed .side-panel.open {
        transform: translateX(0);
    }

}