/* Shared base styles across Attend pages. Vanilla CSS, no framework.
   Layout pattern (sticky glass header, hamburger + off-canvas dark sidebar)
   is modeled on Campistry's own app shell -- proven, familiar UX for admins
   who may know that product -- restyled in Attend's own blue, not
   Campistry's teal/gold brand (mirroring how Campistry's own sibling
   products -- Flow teal, Me gold, Live blue -- each keep a distinct accent
   while sharing one design system; Attend's blue is close to Live's).
   Fonts and design tokens (radius/shadow/spacing scale, easing) match
   Campistry's own campistry-unified.css structurally -- same names, same
   values where there's no reason to differ. */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700;9..40,800&display=swap');

:root {
    /* Brand */
    --accent: #2f6fed;
    --accent-dark: #1d4ed8;
    --accent-light: #eaf1ff;
    --danger: #d93025;
    --success: #16a34a;
    --warning: #a16207;

    /* Typography -- DM Sans for everything, including what would otherwise
       be "display" moments (hero headline, section titles, stat numbers).
       Campistry's own campistry-unified.css splits DM Sans/Fraunces for
       that; Attend uses DM Sans throughout instead (the serif read as
       heavier than wanted here) -- --font-display kept as its own token,
       just aliased to the body font, so every rule already using it didn't
       need to change individually. */
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: var(--font-body);

    /* Neutrals (a standard slate ramp -- brand-agnostic) */
    --slate-50:  #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --slate-950: #020617;

    /* Legacy names kept stable -- referenced inline across the JS files */
    --bg: var(--slate-50);
    --panel: #ffffff;
    --border: var(--slate-200);
    --text: var(--slate-900);
    --text-muted: var(--slate-500);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 999px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 8px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 8px 20px rgba(15, 23, 42, 0.10);

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --transition: 0.2s var(--ease-out);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
}

a { color: var(--accent); }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 20px;
    box-shadow: var(--shadow-md);
}

/* ============================================
   Buttons -- pill-shaped, matching Campistry's system
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition), transform 0.1s ease;
    box-shadow: 0 1px 3px rgba(47, 111, 237, 0.25);
    text-decoration: none;
}
.btn:hover { background: var(--accent-dark); box-shadow: 0 2px 8px rgba(47, 111, 237, 0.3); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn.secondary { background: #fff; color: var(--slate-700); border-color: var(--slate-300); box-shadow: none; }
.btn.secondary:hover { background: var(--slate-50); border-color: var(--slate-400); }
.btn.danger { background: var(--danger); box-shadow: 0 1px 3px rgba(217, 48, 37, 0.25); }
.btn.danger:hover { background: #b8261c; }

/* ============================================
   Forms
   ============================================ */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--text-muted); }
.field input, .field select, .field textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus, .field select:focus, .field textarea:focus,
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.error-text { color: var(--danger); font-size: 13px; margin-top: 8px; }
.muted { color: var(--text-muted); font-size: 13px; }

/* ============================================
   App shell -- sticky header + hamburger + off-canvas sidebar
   ============================================ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--slate-200);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.header-left, .header-right { display: flex; align-items: center; gap: 12px; }

/* Track toggle, centered in the header regardless of how wide the left
   (logo) and right (sign out) content are -- absolute + translate rather
   than flex space-between, since the two sides are never equal width. */
.header-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: calc(100% - 300px);
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
}
.header-center::-webkit-scrollbar { display: none; }
.header-center .tab-strip { flex-wrap: nowrap; }
.header-center .tab-pill { padding: 6px 14px; font-size: 12.5px; white-space: nowrap; }

/* ============================================
   Brand lockup -- the ATTEND logo image + "by Campistry" line.
   Two sizes: compact in the header, larger as the login-page hero.
   ============================================ */
.app-title, .brand-hero { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.brand-hero { align-items: center; margin-bottom: 4px; }
.brand-logo { height: 20px; width: auto; display: block; }
.brand-hero .brand-logo { height: 42px; }
.brand-by {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--slate-400);
    margin-top: 5px;
}
.brand-hero .brand-by { font-size: 0.8rem; margin-top: 10px; }

/* ============================================
   Auth card -- the sign-in/sign-up page, styled after Campistry's own
   auth modal (same card shape/shadow, toggle-pill mode switcher) even
   though here it lives on its own page rather than as an overlay.
   ============================================ */
body.auth-page {
    min-height: 100vh;
    background: radial-gradient(ellipse 80% 60% at 50% -10%, var(--accent-light), transparent), var(--bg);
}
.auth-card {
    padding: 34px 32px;
    box-shadow: var(--shadow-lg);
}
.auth-toggle {
    display: flex;
    background: var(--slate-100);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 20px;
}
.auth-toggle-btn {
    flex: 1;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: var(--slate-500);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition);
}
.auth-toggle-btn.active { color: #fff; background: var(--accent); }
.auth-card .field input {
    background: var(--accent-light);
    border-color: transparent;
}
.auth-card .field input:focus {
    background: #fff;
    border-color: var(--accent);
}
.auth-footer { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 18px; line-height: 1.5; }
.auth-footer a { color: var(--accent-dark); }
.auth-footer a:hover { text-decoration: underline; }

.hamburger-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--slate-200);
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}
.hamburger-btn span { display: block; height: 2px; width: 18px; border-radius: 2px; background: var(--slate-600); transition: all var(--transition); }
.hamburger-btn:hover { background: var(--slate-50); border-color: var(--slate-300); }
.hamburger-btn:hover span { background: var(--accent); }

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(2, 6, 23, 0.5);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 250px;
    background: linear-gradient(180deg, #0a0f1e 0%, #020617 100%);
    padding: 74px 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease-out);
    z-index: 45;
    overflow-y: auto;
}
body.sidebar-open .sidebar { transform: translateX(0); }
body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: rgba(203, 213, 225, 0.75);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
}
.sidebar-item:hover { background: rgba(148, 163, 184, 0.1); color: #f1f5f9; }
.sidebar-item.active { background: rgba(47, 111, 237, 0.18); color: #fff; font-weight: 600; }
.sidebar-item .sidebar-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(100, 116, 139, 0.5); flex-shrink: 0; }
.sidebar-item.active .sidebar-dot { background: #7ba4f7; box-shadow: 0 0 8px rgba(123, 164, 247, 0.6); }

/* ============================================
   Tab strip -- for switching between independent attendance sessions
   (e.g. "Hebrew Studies" / "Secular Studies") on Setup, Print Sheets, and
   Dashboard.
   ============================================ */
.tab-strip { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tab-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    border: 1px solid var(--slate-200);
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: var(--slate-600);
    cursor: pointer;
    transition: all var(--transition);
}
.tab-pill:hover { background: var(--slate-50); border-color: var(--slate-300); }
.tab-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab-pill-add {
    padding: 8px 14px;
    border-radius: var(--radius-full);
    border: 1px dashed var(--slate-300);
    background: transparent;
    color: var(--slate-500);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}
.tab-pill-add:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================
   Chips
   ============================================ */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--slate-50);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 13px;
    cursor: grab;
}
.chip .rm { color: var(--danger); cursor: pointer; font-weight: 700; }

/* ============================================
   Tables
   ============================================ */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: none; }

/* ============================================
   Modals
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(2, 6, 23, 0.45);
    align-items: center; justify-content: center;
    z-index: 100;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: var(--panel);
    border-radius: var(--radius-xl);
    padding: 22px;
    width: 420px;
    max-width: 92vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal-box h3 { margin-top: 0; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ============================================
   Dashboard hero -- modeled on Campistry's own dashboard.css dash-hero
   (gradient banner, greeting + welcome title, a widget on the right),
   restyled in Attend's blue and with a clock instead of a weather widget
   (not relevant here) and no per-product quick-launch tiles (Attend is
   single-purpose).
   ============================================ */
.dash-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 30px 32px;
    margin: 20px 0;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border-radius: var(--radius-xl);
    color: #fff;
}
.dash-greeting { font-size: 0.85rem; opacity: 0.8; margin: 0 0 4px; letter-spacing: 0.02em; }
.dash-hero-title { font-size: 1.6rem; font-weight: 700; color: #fff; margin: 0 0 4px; letter-spacing: -0.01em; }
.dash-hero-sub { font-size: 0.9rem; color: rgba(255, 255, 255, 0.78); margin: 0; }
.dash-clock-widget {
    text-align: right;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.dash-clock-time { font-size: 1.4rem; font-weight: 700; line-height: 1.2; }
.dash-clock-date { font-size: 0.72rem; opacity: 0.75; }

/* ============================================
   Stat tiles
   ============================================ */
.stat-tile {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    min-width: 160px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
}
.stat-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--accent-light);
    color: var(--accent-dark);
}
.stat-tile.present .stat-icon { background: rgba(22, 163, 74, 0.1); color: var(--success); }
.stat-tile.absent .stat-icon { background: rgba(217, 48, 37, 0.1); color: var(--danger); }
.stat-tile.pending .stat-icon { background: rgba(161, 98, 7, 0.1); color: var(--warning); }
.stat-tile .stat-value { font-size: 24px; font-weight: 800; line-height: 1.1; color: var(--slate-900); }
.stat-tile .stat-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.stat-tile.present .stat-value { color: var(--success); }
.stat-tile.absent .stat-value { color: var(--danger); }
.stat-tile.pending .stat-value { color: var(--warning); }

/* ============================================
   Landing page -- structurally modeled on Campistry's own index.html/
   landing.css (fixed frosted nav, badge-pill above a big Fraunces
   headline with a gradient accent word, card-grid explainer section)
   restyled in Attend's own blue rather than Campistry's teal/gold.
   ============================================ */
.landing-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 32px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--slate-200);
}
.landing-nav-links { display: flex; gap: 28px; flex: 1; justify-content: center; }
.landing-nav-links a { font-size: 0.9rem; font-weight: 500; color: var(--slate-600); transition: color var(--transition); }
.landing-nav-links a:hover { color: var(--accent-dark); }
.landing-nav-actions { display: flex; align-items: center; gap: 10px; }
.landing-hero {
    text-align: center;
    padding: 88px 24px 40px;
    max-width: 720px;
    margin: 0 auto;
}
.landing-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
    margin-top: 48px;
    flex-wrap: wrap;
}
.landing-stat { text-align: center; }
.landing-stat-value { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--slate-900); }
.landing-stat-label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.landing-stat-divider { width: 1px; height: 32px; background: var(--slate-200); }
.section-header { text-align: center; max-width: 560px; margin: 0 auto 36px; }
.section-eyebrow { display: block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-dark); margin-bottom: 8px; }
.section-title { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; color: var(--slate-900); margin: 0; }
.section-sub { font-size: 0.98rem; color: var(--slate-600); margin-top: 10px; line-height: 1.6; }
.landing-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--slate-600);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}
.landing-badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.landing-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.1rem, 5vw, 3.1rem);
    font-weight: 600;
    color: var(--slate-900);
    margin: 0;
    line-height: 1.15;
    letter-spacing: -0.02em;
}
.landing-hero h1 .accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.landing-hero p { font-size: 1.1rem; color: var(--slate-600); margin-top: 18px; line-height: 1.65; }
.landing-cta-row { display: flex; gap: 12px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
.landing-cta-row .btn { padding: 13px 28px; font-size: 15px; }
.landing-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 8px 24px 80px;
}
.landing-step {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-xl);
    padding: 26px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}
.landing-step:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.landing-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent-dark);
    font-family: var(--font-display);
    font-weight: 600;
    margin-bottom: 14px;
}
.landing-step h3 { margin: 0 0 6px; font-size: 1.1rem; color: var(--slate-900); font-weight: 700; }
.landing-step p { margin: 0; font-size: 0.9rem; color: var(--text-muted); line-height: 1.55; }
.landing-section { padding: 64px 24px; }
.landing-section.alt { background: var(--slate-50); border-top: 1px solid var(--slate-200); border-bottom: 1px solid var(--slate-200); }
.pricing-table {
    max-width: 720px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 28px;
    border-bottom: 1px solid var(--slate-100);
}
.pricing-row:last-child { border-bottom: none; }
.pricing-row.highlight { background: var(--accent-light); }
.pricing-students { font-weight: 600; color: var(--slate-900); }
.pricing-note { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }
.pricing-rate { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; color: var(--accent-dark); white-space: nowrap; }
.pricing-rate span { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); font-family: var(--font-body); }
.pricing-footnote { text-align: center; max-width: 560px; margin: 24px auto 0; font-size: 0.85rem; color: var(--text-muted); }
.landing-footer { text-align: center; padding: 32px 24px; color: var(--slate-400); font-size: 0.8rem; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 720px) {
    .landing-steps { grid-template-columns: 1fr; }
    .landing-hero h1 { font-size: 1.7rem; }
}
@media (max-width: 640px) {
    .container { padding: 16px; }
    .app-header {
        padding: 8px 14px;
        height: auto;
        flex-wrap: wrap;
        row-gap: 8px;
    }
    /* Not enough room to stay centered between the logo and Sign out on one
       row -- drop to a full-width row of its own, still centered. */
    .header-center {
        position: static;
        order: 3;
        transform: none;
        width: 100%;
        max-width: 100%;
        justify-content: center;
    }
    .field { margin-bottom: 12px; }
    .landing-nav { padding: 16px 20px; }
}
