/* BeaconLens refreshed look. Loaded after beacon.css and extra.css.
   Part 1 sets the shared foundations (type, corners, shadows, motion). Part 2
   styles the screens themselves. School colors still come from
   --navy and --accent (see lib/theme.ts). */

/* ---------- Part 1: foundations ---------- */
:root {
--font-heading: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
--font-num: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
--font-report: 'Atkinson Hyperlegible', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
--radius: 12px;
--radius-sm: 8px;
--radius-xs: 6px;
--shadow: 0 1px 2px rgba(20,25,45,.05), 0 12px 32px rgba(20,25,45,.06);
--ease: cubic-bezier(.32,.72,0,1);
}

/* Headings: Poppins SemiBold. The BeaconLens wordmark keeps its own serif. */
.greeting, h2.section-title, #content .dt-card h3 { font-family: var(--font-heading); font-weight: 600; letter-spacing: -.01em; }

/* Numbers: Inter Medium, with digits that line up in columns. */
.stat-card .num, .bt-big { font-family: var(--font-num); font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* Squarer corners */
.btn, input, select, textarea, .top-link, .sso-btn, .toast, .user-badge, .school-switch select { border-radius: var(--radius-sm); }
.pill, .soft-pill, .fu-chip, .new-badge { border-radius: var(--radius-xs); }
.modal, .auth-card, .trend-card, .goal-card, .join-card, .banner, .notes-log { border-radius: var(--radius); }

/* Buttons press down slightly when tapped */
.btn { transition: background .15s, opacity .15s, transform .25s var(--ease); }
.btn:active:not(:disabled) { transform: scale(.97); }
/* Keyboard focus: an outline that reads on white whatever colors a school picks.
   Text boxes get it too; older rules removed theirs and left only a border tint. */
:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus, var(--accent)) !important; outline-offset: 1px; }
/* A message the page was loaded to show is given focus so it is read out; it needs no ring. */
.notice:focus { outline: none; }

/* "Skip to content": the first stop for a keyboard, hidden until it has focus. */
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 1000; padding: 10px 16px; border-radius: 8px; background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.skip-link:focus { left: 8px; }
#main { display: block; height: 0; outline: none; scroll-margin-top: 8px; }

/* Tab bar: stays in view while scrolling, with a highlight that slides between tabs.
   The .tab-ind element and the .has-ind class are added by beacon-app.js; without
   them the active tab keeps its original solid background. */
nav.tabs { position: sticky; top: 8px; z-index: 20; border-radius: 10px; background: rgba(255,255,255,.82); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
nav.tabs button { position: relative; z-index: 1; border-radius: 7px; transition: background .15s, color .3s; }
nav.tabs .tab-ind { position: absolute; top: 5px; left: 0; height: calc(100% - 10px); width: 0; border-radius: 7px; background: var(--navy); pointer-events: none; }
nav.tabs.has-ind .tab-ind { transition: transform .5s var(--ease), width .5s var(--ease); }
nav.tabs.has-ind button.active, nav.tabs.has-ind button.active:hover { background: transparent; color: var(--navy-on); }

/* ---------- Part 2: screens ---------- */
@keyframes bl-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes bl-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes bl-rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes bl-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bl-pop { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }

/* Titles, cards and stat tiles */
.greeting { font-size: clamp(24px, 3.5vw, 34px); line-height: 1.12; letter-spacing: -.015em; margin: 6px 0 22px; }
h2.section-title { font-size: 18px; }
.card, .stat-card, .trend-card, #content .dt-card { border-color: rgba(20,25,45,.06); }
.card { padding: 24px; }
#content .dt-card { border-radius: var(--radius); }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 18px; }
.stat-card { padding: 20px 22px; }
.stat-card .num { font-size: 34px; line-height: 1.05; }
.stat-card .lbl { font-size: 13px; margin-top: 6px; }
.stat-card.highlight { border: 2px solid var(--accent); transition: background .15s, transform .25s var(--ease); }
.stat-card.highlight:active { transform: scale(.98); }

/* A screen eases in when you move to it. beacon-app.js adds .tab-enter only when
   the screen changes, so filters, saves and live updates do not replay it. */
#content.tab-enter > * { animation: bl-in .6s var(--ease) both; }
#content.tab-enter > *:nth-child(2) { animation-delay: .06s; }
#content.tab-enter > *:nth-child(3) { animation-delay: .12s; }
#content.tab-enter > *:nth-child(4) { animation-delay: .18s; }
#content.tab-enter > *:nth-child(n+5) { animation-delay: .24s; }
#content.tab-enter .stat-card,
#content.tab-enter .trend-grid > .trend-card,
#content.tab-enter .dt-grid > .dt-card { animation: bl-in .6s var(--ease) both; }
#content.tab-enter .stat-card:nth-child(1), #content.tab-enter .trend-card:nth-child(1), #content.tab-enter .dt-card:nth-child(1) { animation-delay: .06s; }
#content.tab-enter .stat-card:nth-child(2), #content.tab-enter .trend-card:nth-child(2), #content.tab-enter .dt-card:nth-child(2) { animation-delay: .11s; }
#content.tab-enter .stat-card:nth-child(3), #content.tab-enter .trend-card:nth-child(3), #content.tab-enter .dt-card:nth-child(3) { animation-delay: .16s; }
#content.tab-enter .stat-card:nth-child(4), #content.tab-enter .trend-card:nth-child(4), #content.tab-enter .dt-card:nth-child(4) { animation-delay: .21s; }
#content.tab-enter .stat-card:nth-child(5), #content.tab-enter .trend-card:nth-child(5), #content.tab-enter .dt-card:nth-child(5) { animation-delay: .26s; }
#content.tab-enter .stat-card:nth-child(n+6), #content.tab-enter .trend-card:nth-child(n+6), #content.tab-enter .dt-card:nth-child(n+6) { animation-delay: .31s; }

/* Count bars fill from the left; the monthly goal chart rises from its baseline. */
.dash-bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.dash-bar-fill { height: 100%; background: var(--accent); border-radius: 99px; transform-origin: left; }
.goal-col { transform-origin: bottom; }
#content.tab-enter .dash-bar-fill { animation: bl-grow 1s var(--ease) .3s both; }
#content.tab-enter .goal-col { animation: bl-rise .9s var(--ease) .25s both; }

/* Rating and tag buttons */
.rating-btn { border-radius: 7px; padding: 8px 12px; transition: background .2s, color .2s, border-color .2s, transform .25s var(--ease); }
.rating-btn:active { transform: scale(.95); }
.rating-note, .cfu-card, .goal-last, .clickable-row, .follow-item, .status-box, .notice, #content .dt-chip { border-radius: var(--radius-sm); }
.note-tag, .note-ns-btn, .note-tag-opt { border-radius: var(--radius-xs); }
tbody td { transition: background .15s; }

/* Pop-up windows and the confirmation message */
.modal-backdrop { animation: bl-fade .25s ease both; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal { animation: bl-pop .4s var(--ease) both; }
.toast { transform: translate(-50%, 12px); transition: opacity .25s, transform .4s var(--ease); }
.toast.show { transform: translate(-50%, 0); }

/* Sign-in, school settings and platform pages */
.auth-card { animation: bl-in .7s var(--ease) both; }
.sso-btn { transition: background .15s, transform .25s var(--ease); }
.sso-btn:active:not(:disabled) { transform: scale(.98); }
.admin-table input[type=text], .admin-table input[type=email], .admin-table select,
.admin-form input, .admin-form textarea, .admin-form select { border-radius: var(--radius-sm); }

/* Reports: Atkinson Hyperlegible, on screen and in the printable report. */
#content[data-tab="reports"], #content[data-tab="reports"] h2.section-title { font-family: var(--font-report); }
#content[data-tab="reports"] h2.section-title { font-weight: 700; letter-spacing: 0; }

/* Moving between pages cross-fades, in browsers that support it. */
@media (prefers-reduced-motion: no-preference) {
@view-transition { navigation: auto; }
}

@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
