/* Plan 006: forms.css — Form element styles
   Extracted from frontend/styles.css on 2026-04-03
   Extended: form-adjacent layout, typeahead, checkbox groups added on 2026-04-03 (Milestone 19) */

.form-group {
    margin-bottom: var(--space-5);
    position: relative;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--form-border-color);
    border-radius: var(--form-radius);
    font-size: 14px;
    background-color: #fff;
    line-height: var(--form-line-height);
    box-shadow: var(--form-surface-shadow), var(--form-field-shadow-inset);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="range"] {
    width: 100%;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background-color: transparent;
}

input[readonly] {
    background-color: #f2f2f2;
    color: #777;
    cursor: not-allowed;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

input[type="text"]:focus-visible,
input[type="email"]:focus-visible,
input[type="number"]:focus-visible,
input[type="date"]:focus-visible,
input[type="time"]:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    border-color: var(--form-focus-color);
    box-shadow: var(--form-focus-ring), var(--form-field-shadow-inset);
}

.field-error,
.field-error:focus-visible,
.field-error:focus,
.field-error:invalid {
    outline: none !important;
    border-color: #e03e2d !important;
    border-width: 2px !important;
    box-shadow: none !important;
}

.password-input-wrap input {
    width: 100%;
    box-sizing: border-box;
    padding-left: 12px;
    padding-right: 40px;
    height: 100%;
}


input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    margin: 0;
    padding: 0;
    cursor: pointer;
    background: transparent;
}

/* ── Cobalt-blue range slider (Academic Curator design system) ── */
input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: var(--radius-full);
    background: linear-gradient(
        to right,
        var(--color-primary-700) var(--fill-pct, 60%),
        var(--color-primary-100) var(--fill-pct, 60%)
    );
}

input[type="range"]::-moz-range-track {
    height: 4px;
    border-radius: var(--radius-full);
    background: var(--color-primary-100);
}

input[type="range"]::-moz-range-progress {
    height: 4px;
    border-radius: var(--radius-full);
    background: var(--color-primary-700);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: var(--color-primary-700);
    border: 2px solid var(--bg-surface);
    margin-top: -7px;
    box-shadow: var(--shadow-slider-thumb);
    transition: var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: 2px solid var(--bg-surface);
    border-radius: var(--radius-full);
    background: var(--color-primary-700);
    box-shadow: var(--shadow-slider-thumb);
    transition: var(--transition-fast);
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
    box-shadow: var(--shadow-focus);
}

input[type="range"]:focus-visible::-moz-range-thumb {
    box-shadow: var(--shadow-focus);
}

.metric-label-row label,
.metric-label-title-group > label {
    margin-bottom: 0;
}


.session-editor-form label {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    color: var(--fg-secondary);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
}

.session-editor-form select,
.session-editor-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23334155' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ── Section title ── */


/* ── Form layout rows ── */

.form-row.three-col {
    grid-template-columns: 1fr 1fr 1fr;
}

/* ── Session editor row (split-width layout) ── */
.session-editor-row {
    display: flex;
    gap: 15px;
}

.session-editor-col {
    flex: 1;
    min-width: 0;
}

.session-editor-col--60 {
    flex: 0 0 60%;
}

.session-editor-col--20 {
    flex: 0 0 20%;
}

/* ── Checkbox / radio groups ── */


/* ── Sliders ── */
.slider-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.slider-row input[type="range"] {
    flex: 1;
}

/* Score badge — lives in .metric-label-row (right edge) */
.slider-value {
    background: var(--bg-surface-alt);
    color: var(--fg-primary);
    padding: 3px var(--space-2);
    border-radius: var(--radius-sm);
    min-width: 36px;
    text-align: center;
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    flex-shrink: 0;
}

/* Metric label row — space-between so score badge aligns right */
.metric-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

/* Left group: label + info-btn */
.metric-label-title-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* ── Typeahead dropdown ── */
#studentDropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}


/* ── Multi-select metric chips ── */
.metric-chip-cloud {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.metric-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-full);
    background: #f8fafc;
    color: #94a3b8;
    font-size: 11px;
    font-weight: var(--weight-semibold, 600);
    cursor: pointer;
    transition: var(--transition-base);
    line-height: 1.4;
    letter-spacing: 0.01em;
    user-select: none;
}

.metric-chip.active {
    background: #eff6ff;
    color: #1a4fcf;
    border-color: #1a4fcf;
    font-weight: 700;
}

.metric-chip:hover:not(.active) {
    color: #475569;
    border-color: #cbd5e1;
}

.is-comment-highlighted {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2) !important;
}

/* =============================================================================
   Student Search Panel — Search-First Create Flow (Plan 010)
   ============================================================================= */


.student-search-status {
    line-height: 1.5;
    color: var(--text-secondary, #555);
    margin-bottom: 0.4rem;
}

.student-search-status.search-status-searching {
    font-style: italic;
}

.student-search-status.search-status-match-found {
    color: #92600a;
    font-weight: 500;
}

.student-search-status.search-status-create-confirmed {
    font-style: italic;
}


.student-search-match-item.is-selected {
    background: #e8f0fe;
    border-left: 3px solid var(--form-focus-color, #6366a3);
    padding-left: calc(0.75rem - 3px);
}


@media (max-width: 640px) {

}

/* ── Subject autocomplete ─────────────────────────────────────────────────── */

.subject-ac-wrapper {
    position: relative;
    width: 100%;
}

.subject-ac-panel {
    display: none;
    position: absolute;
    top: calc(100% + var(--space-1));
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 30;
    overflow: hidden;
    max-height: 200px;
    overflow-y: auto;
}

.subject-ac-panel.is-open {
    display: block;
}

.subject-ac-option {
    padding: var(--space-2) var(--space-3);
    cursor: pointer;
    font-size: var(--text-body);
    color: var(--fg-primary);
    transition: background-color var(--transition-fast);
}

.subject-ac-option.is-active,
.subject-ac-option:hover {
    background-color: var(--color-primary-50);
    color: var(--color-primary-700);
    font-weight: var(--weight-medium);
}
