/* ============================================================
   school.css
   Styles for the unified BrainBuzz school login, verify,
   and dashboard pages at /school/.
   ============================================================ */

/* ── Variables ───────────────────────────────────────────────── */
:root {
    --bb-primary:       #6473df;
    --bb-primary-dark:  #4f5fcb;
    --bb-primary-light: rgba(100,115,223,.1);
    --bb-accent:        #90dfcc;
    --bb-bg:            #f5f6fb;
    --bb-border:        #e9ecef;
    --bb-text:          #333;
    --bb-muted:         #6c757d;
}

/* ── Shared form elements ────────────────────────────────────── */
.form-label {
    font-weight: 600; font-size: .875rem; color: var(--bb-text);
    display: block; margin-bottom: .35rem;
}
.form-control {
    width: 100%; border: 2px solid var(--bb-border); border-radius: .6rem;
    padding: .6rem .85rem; font-size: .95rem; box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
    border-color: var(--bb-primary);
    box-shadow: 0 0 0 3px var(--bb-primary-light);
    outline: none;
}
.form-hint { font-size: .78rem; color: var(--bb-muted); margin-top: .3rem; }

/* ── Alerts ──────────────────────────────────────────────────── */
.form-alert {
    border-radius: .6rem; padding: .75rem 1rem; font-size: .875rem;
    margin-bottom: 1rem; display: none; align-items: flex-start; gap: .5rem;
}
.form-alert.show    { display: flex; }
.form-alert.error   { background: #fde8e9; border: 1px solid #f5c6cb; color: #842029; }
.form-alert.success { background: #d1f2ea; border: 1px solid #90dfcc;  color: #0a6547; }
.form-alert.warning { background: #fff8e1; border: 1px solid #ffc107;  color: #856404; }

/* ── Primary gradient button ─────────────────────────────────── */
.btn-school {
    background: linear-gradient(135deg, var(--bb-primary) 0%, var(--bb-accent) 100%);
    border: none; color: white; font-weight: 700; border-radius: 2rem;
    cursor: pointer; transition: all .2s;
    width: 100%; margin-top: .5rem; padding: .75rem 2rem; font-size: 1rem;
}
.btn-school:hover    { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(100,115,223,.3); }
.btn-school:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ── Spinner ─────────────────────────────────────────────────── */
.spinner-sm {
    display: inline-block; width: .9rem; height: .9rem;
    border: 2px solid rgba(255,255,255,.4); border-top-color: white;
    border-radius: 50%; animation: bb-spin .6s linear infinite;
    margin-right: .4rem; vertical-align: -.15em;
}
@keyframes bb-spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════════
   LOGIN & VERIFY PAGES
   ══════════════════════════════════════════════════════════════ */
.access-hero {
    background: linear-gradient(135deg, rgba(100,115,223,.12) 0%, rgba(144,223,204,.12) 100%);
    border-bottom: 1px solid rgba(100,115,223,.15);
    padding: 3rem 0 2.5rem; text-align: center;
}
.access-hero-icon {
    width: 3.5rem; height: 3.5rem;
    background: linear-gradient(135deg, var(--bb-primary), var(--bb-accent));
    border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.75rem; color: white;
    margin-bottom: 1rem;
}
.access-hero h1 { font-size: clamp(1.4rem,4vw,2rem); font-weight: 800; margin-bottom: .4rem; }
.access-hero p  { color: #555; font-size: 1rem; margin: 0; }

.access-card {
    background: white; border-radius: 14px;
    box-shadow: 0 2px 20px rgba(0,0,0,.08);
    padding: 2.5rem;
    max-width: 480px; margin: 2rem auto;
}
.access-card .form-label   { margin-bottom: .5rem; }
.access-card .form-control { padding: .8rem 1rem; font-size: 1rem; }
.access-card .form-hint    { margin-top: .5rem; margin-bottom: 1.25rem; }
.access-card .btn-school   { margin-top: .25rem; padding: .9rem; font-size: 1.05rem; }

.access-footer {
    text-align: center; font-size: .85rem;
    color: var(--bb-muted); margin-top: 1.5rem; line-height: 1.6;
}

/* ── OTP digit inputs ────────────────────────────────────────── */
.otp-input-row {
    display: flex; align-items: center; justify-content: center;
    gap: .5rem; margin: 1rem 0;
}
.otp-digit {
    width: 3rem; height: 3.5rem;
    border: 2px solid var(--bb-border); border-radius: .6rem;
    font-size: 1.5rem; font-weight: 800; text-align: center;
    color: var(--bb-primary); transition: border-color .15s, box-shadow .15s;
    -moz-appearance: textfield;
}
.otp-digit::-webkit-outer-spin-button,
.otp-digit::-webkit-inner-spin-button { -webkit-appearance: none; }
.otp-digit:focus {
    border-color: var(--bb-primary);
    box-shadow: 0 0 0 3px var(--bb-primary-light);
    outline: none;
}
.otp-digit.filled { border-color: var(--bb-primary); background: rgba(100,115,223,.04); }
.otp-sep { font-size: 1.25rem; color: #ccc; font-weight: 300; margin: 0 .25rem; }

@media (max-width: 400px) {
    .otp-digit { width: 2.5rem; height: 3rem; font-size: 1.25rem; }
}

/* ══════════════════════════════════════════════════════════════
   DASHBOARD
   ══════════════════════════════════════════════════════════════ */
.dashboard-hero {
    background: linear-gradient(135deg, var(--hero-gradient-start, rgba(100,115,223,.12)) 0%, var(--hero-gradient-end, rgba(144,223,204,.12)) 100%);
    border-bottom: 1px solid rgba(100,115,223,.15);
    padding: 2.5rem 0;
}
.dashboard-hero h1 {
    font-size: clamp(2rem,5vw,3rem); font-weight: 800; margin-bottom: .5rem;
    color: var(--bb-primary);
}
.dashboard-hero p.lead { font-size: 1.05rem; color: #555; max-width: 580px; }
.dashboard-hero p.admin-info {
    font-size: .92rem; color: #555; margin-top: .75rem;
    padding: .6rem 1rem; background: rgba(255,255,255,.7);
    border-radius: .5rem; border-left: 3px solid var(--bb-primary);
}
.dashboard-hero .school-logo-hero {
    max-height: 320px; max-width: 280px; object-fit: contain;
    background: rgba(255,255,255,.92); padding: 16px 24px;
    border-radius: 14px; box-shadow: 0 4px 20px rgba(0,0,0,.12);
}
@media (max-width: 991px) {
    .dashboard-hero { text-align: center; }
    .dashboard-hero p.lead { margin: 0 auto 1rem; }
    .dashboard-hero p.admin-info { text-align: left; }
}

.product-cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem; max-width: 700px; margin: 2rem auto;
}

.product-card {
    background: white; border-radius: 14px;
    box-shadow: 0 2px 16px rgba(0,0,0,.07);
    padding: 2rem; text-align: center;
    transition: transform .15s, box-shadow .15s;
    text-decoration: none; color: inherit; display: block;
}
.product-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.12);
}
.product-card-link {
    display: block; text-decoration: none; color: inherit;
    text-align: center;
}
.product-card-link:hover { color: inherit; }
.product-card-main-btn {
    display: block; width: 100%; margin-top: 1rem; padding: .65rem 1rem;
    background: linear-gradient(135deg, var(--bb-primary) 0%, var(--bb-accent) 100%);
    color: white; font-weight: 700; font-size: .95rem;
    border: none; border-radius: 2rem; text-decoration: none; text-align: center;
    transition: transform .15s, box-shadow .15s;
}
.product-card-main-btn:hover {
    transform: translateY(-1px); box-shadow: 0 4px 14px rgba(100,115,223,.3); color: white;
}
.product-admin-links {
    margin-top: .75rem; padding-top: .75rem;
    border-top: 1px solid #eee;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem;
}
.product-admin-links a {
    display: flex; align-items: center; justify-content: center;
    font-size: .78rem; font-weight: 600; color: var(--bb-primary);
    text-decoration: none; padding: .45rem .5rem; border-radius: 2rem;
    border: 1.5px solid var(--bb-primary); background: white;
    transition: background .15s, color .15s;
}
.product-admin-links a:hover {
    background: var(--bb-primary); color: white;
}
.product-card-icon {
    width: 3.5rem; height: 3.5rem;
    border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.75rem; color: white;
    margin-bottom: 1rem;
}
.product-card-icon.maths   { background: linear-gradient(135deg, #5867DD, #84DCC6); }
.product-card-icon.spelling { background: linear-gradient(135deg, #6473df, #90dfcc); }

.product-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: .35rem; }
.product-card p  { font-size: .85rem; color: var(--bb-muted); margin: 0; }

.role-badge {
    display: inline-block; font-size: .7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em;
    padding: .2rem .6rem; border-radius: 1rem;
    margin-top: .75rem;
}
.role-badge.admin   { background: rgba(100,115,223,.12); color: var(--bb-primary); }
.role-badge.teacher { background: rgba(144,223,204,.2); color: #0a6547; }

.dashboard-logout {
    text-align: center; margin-top: 2rem;
}
.dashboard-logout a {
    font-size: .85rem; color: var(--bb-muted); text-decoration: none;
}
.dashboard-logout a:hover { color: var(--bb-primary); }

/* ══════════════════════════════════════════════════════════════
   SCHOOL TEACHER BAR (branded gradient)
   ══════════════════════════════════════════════════════════════ */
.school-teacher-bar {
    background: linear-gradient(135deg, var(--bb-primary) 0%, var(--bb-accent) 100%);
    padding: .55rem 0;
    font-size: .82rem;
}
.school-teacher-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.school-teacher-greeting {
    color: rgba(255,255,255,.9);
    display: flex;
    align-items: center;
    gap: .35rem;
}
.school-teacher-greeting i  { color: white; }
.school-teacher-school      { color: rgba(255,255,255,.7); }
.school-teacher-logout {
    color: rgba(255,255,255,.85);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    transition: color .15s;
}
.school-teacher-logout:hover { color: white; }

/* =============================================================
   SCHOOL REGISTRATION — append to school.css
   ============================================================= */

/* Progress bar */
.reg-progress {
    background: #e9ecef;
    border-radius: 99px;
    height: 6px;
    overflow: hidden;
}
.reg-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--bb-primary), var(--bb-accent, #84DCC6));
    border-radius: 99px;
    transition: width .4s ease;
}

/* Step labels */
.reg-steps-labels {
    display: flex;
    justify-content: space-between;
    gap: .25rem;
}
.reg-step-label {
    font-size: .78rem;
    color: #9ca3af;
    font-weight: 500;
    flex: 1;
    text-align: center;
    transition: color .3s;
}
.reg-step-label.active {
    color: var(--bb-primary);
    font-weight: 700;
}
.reg-step-label.done {
    color: #16a34a;
}

/* Card width override for registration (wider than login) */
.reg-card {
    max-width: 680px;
}

/* Step headings */
.reg-step-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bb-primary);
    margin: 0 0 .35rem;
}
.reg-step-intro {
    color: #6b7280;
    font-size: .9rem;
    margin-bottom: 1.5rem;
}
.reg-section-heading {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin: 1.5rem 0 .3rem;
}
.reg-section-intro {
    color: #6b7280;
    font-size: .85rem;
    margin-bottom: 1rem;
}

/* Match warning */
.reg-match-warning {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 10px;
    padding: 1rem 1.1rem;
    margin-bottom: 1.25rem;
}
.reg-match-inner {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
    margin-bottom: .75rem;
}
.reg-match-inner > i {
    color: #d97706;
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: .1rem;
}
.reg-match-inner div {
    font-size: .88rem;
    color: #374151;
    line-height: 1.5;
}
.reg-match-actions {
    display: flex;
    justify-content: flex-end;
}

/* Product grid */
.reg-product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 540px) {
    .reg-product-grid { grid-template-columns: 1fr; }
}

.reg-product-card {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.1rem;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
    gap: .65rem;
    position: relative;
    user-select: none;
}
.reg-product-card:hover {
    border-color: var(--bb-primary);
}
.reg-product-card.selected {
    border-color: var(--bb-primary);
    box-shadow: 0 0 0 3px rgba(88,103,221,.12);
    background: rgba(88,103,221,.03);
}
.reg-product-coming-soon {
    opacity: .65;
    cursor: not-allowed;
}
.reg-product-coming-soon:hover {
    border-color: #e5e7eb;
}

.reg-product-check {
    position: absolute;
    top: .9rem;
    right: .9rem;
}
.reg-product-check input[type="checkbox"] {
    display: none;
}
.reg-product-checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .8rem;
    transition: background .2s, border-color .2s;
}
.reg-product-card.selected .reg-product-checkmark {
    background: var(--bb-primary);
    border-color: var(--bb-primary);
}

.reg-product-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.maths-icon  { background: rgba(88,103,221,.12); color: var(--bb-primary); }
.spelling-icon { background: rgba(132,220,198,.2); color: #059669; }

.reg-product-name {
    font-weight: 700;
    font-size: .95rem;
    color: #111827;
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}
.reg-product-desc {
    font-size: .82rem;
    color: #6b7280;
    line-height: 1.5;
}
.reg-product-price {
    font-size: .85rem;
    font-weight: 600;
    color: var(--bb-primary);
    margin-top: auto;
}
.reg-coming-soon-badge {
    background: #f3f4f6;
    color: #6b7280;
    font-size: .7rem;
    font-weight: 600;
    padding: .15rem .45rem;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Seats control */
.reg-seats-control {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: fit-content;
}
.reg-seats-btn {
    width: 38px;
    height: 38px;
    border: 2px solid var(--bb-primary);
    border-radius: 8px;
    background: #fff;
    color: var(--bb-primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s, color .2s;
    flex-shrink: 0;
}
.reg-seats-btn:hover {
    background: var(--bb-primary);
    color: #fff;
}
.reg-seats-input {
    width: 80px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Billing radio options */
.reg-billing-options {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    margin-bottom: .5rem;
}
.reg-radio-option {
    display: flex;
    align-items: center;
    gap: .65rem;
    cursor: pointer;
    font-size: .9rem;
    color: #374151;
}
.reg-radio-option input[type="radio"] { display: none; }
.reg-radio-mark {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s;
}
.reg-radio-option input:checked ~ .reg-radio-mark {
    border-color: var(--bb-primary);
    border-width: 6px;
}

/* Discount row */
.reg-discount-row {
    display: flex;
    gap: .5rem;
}
.reg-discount-input {
    max-width: 200px;
    font-family: monospace;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.reg-discount-btn {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Summary table */
.reg-summary {
    margin-bottom: 1.25rem;
}
.reg-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
    margin-bottom: .75rem;
}
.reg-summary-table thead th {
    background: var(--bb-primary);
    color: #fff;
    padding: .55rem .85rem;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
    font-size: .9rem;
}
.reg-summary-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
}
.reg-summary-table tbody td {
    padding: .45rem .85rem;
    color: #374151;
}
.reg-summary-table tbody tr:nth-child(even) td {
    background: #f9fafb;
}
.reg-summary-discount td { color: #16a34a !important; }
.reg-summary-total td {
    padding: .65rem .85rem;
    font-weight: 700;
    font-size: .95rem;
    color: #111827;
    background: #f3f4f6;
}
.reg-summary-billing {
    font-size: .85rem;
    color: #6b7280;
    padding: .4rem .85rem;
}

/* Invoice note */
.reg-invoice-note {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    background: rgba(88,103,221,.07);
    border-left: 3px solid var(--bb-primary);
    border-radius: 0 8px 8px 0;
    padding: .85rem 1rem;
    margin-bottom: 1.25rem;
    font-size: .87rem;
    color: #374151;
    line-height: 1.5;
}
.reg-invoice-note > i {
    color: var(--bb-primary);
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: .1rem;
}

/* Terms */
.reg-terms-label {
    display: flex;
    gap: .65rem;
    align-items: flex-start;
    cursor: pointer;
    font-size: .88rem;
    color: #374151;
    line-height: 1.5;
}
.reg-terms-label input[type="checkbox"] {
    margin-top: .15rem;
    flex-shrink: 0;
    accent-color: var(--bb-primary);
    width: 16px;
    height: 16px;
}
.reg-terms-label a { color: var(--bb-primary); }

/* Nav buttons row */
.reg-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.75rem;
    gap: .75rem;
}

/* Success */
.reg-success {
    text-align: center;
    padding: 1.5rem 0;
}
.reg-success-icon {
    font-size: 3.5rem;
    color: #16a34a;
    margin-bottom: 1rem;
}
.reg-success h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: .75rem;
}
.reg-success p {
    color: #6b7280;
    margin-bottom: .5rem;
}

/* Outline button variant (if not already in school.css) */
.btn-school-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .6rem 1.4rem;
    border: 2px solid var(--bb-primary);
    border-radius: 8px;
    background: transparent;
    color: var(--bb-primary);
    font-weight: 600;
    font-size: .92rem;
    cursor: pointer;
    transition: background .2s, color .2s;
    text-decoration: none;
}
.btn-school-outline:hover {
    background: var(--bb-primary);
    color: #fff;
}
/* ══════════════════════════════════════════════════════════════
   OPTION CARDS  (.bb-option-card)
   Reusable full-width centred action card — used on the
   registration page options and the school dashboard.
   ══════════════════════════════════════════════════════════════ */
.bb-option-card {
    background: white;
    border: 2px solid var(--bb-primary);
    color: var(--bb-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 140px;
    padding: 1.5rem 1.25rem;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    box-sizing: border-box;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.bb-option-card:hover,
.bb-option-card:focus {
    background: var(--bb-primary);
    color: white;
    text-decoration: none;
}
/* Larger padding for registration-step contexts */
.bb-option-card.bb-option-card--lg {
    min-height: 200px;
    padding: 1.75rem 1.5rem;
}
.bpc-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: .6rem;
    line-height: 1;
}
.bpc-title {
    font-size: 1rem;
    font-weight: 700;
    display: block;
    margin-bottom: .3rem;
}
.bpc-desc {
    font-size: .8rem;
    font-weight: 400;
    line-height: 1.55;
    display: block;
    opacity: .85;
}