/*
  Moja Matura — student_web_app design system.
  Colors, type and radii are ported 1:1 from the Flutter design tokens in
  packages/shared-package/lib/common/tokens.dart (MMColors / MMType / MMRadius)
  so the web app and the student mobile app read as the same product.
*/

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/BricolageGrotesque-Variable.ttf") format("truetype-variations"),
       url("../fonts/BricolageGrotesque-Variable.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/PlusJakartaSans-Variable.ttf") format("truetype-variations"),
       url("../fonts/PlusJakartaSans-Variable.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  /* --- MMColors (light) --- */
  --mm-surface: #FFFFFF;
  --mm-surface-muted: #F8F4F4;
  --mm-text: #201E1D;
  --mm-text-muted: #605D5D;
  --mm-text-faint: #BAB6B6;

  --mm-primary: #0088B0;
  --mm-primary-tint: #E9F8FF;
  --mm-primary-deep: #004961;
  --mm-primary-mid: #006786;

  --mm-ink2: #D6006C;
  --mm-ink2-tint: #FFF1F4;
  --mm-ink2-deep: #790E3D;

  --mm-ink3: #EDBB00;
  --mm-ink3-tint: #FDF3D6;
  --mm-ink3-deep: #6D5800;

  --mm-ink4: #605D5D;
  --mm-ink4-tint: #EAE7E7;
  --mm-ink4-deep: #2D2B2B;

  --mm-border: #D7D3D3;
  --mm-track-inactive: #EAE7E7;

  /* --- spacing (MMSpace) --- */
  --sp-2: 10px;
  --sp-3: 15px;
  --sp-4: 20px;
  --sp-6: 30px;
  --sp-8: 40px;

  /* --- radii (MMRadius) --- */
  --r-icon-tile: 10px;
  --r-list-row: 10px;
  --r-segment: 11px;
  --r-field: 12px;
  --r-logo-small: 8px;
  --r-logo-large: 18px;
  --r-pill: 999px;

  --font-heading: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "Plus Jakarta Sans", "Segoe UI", sans-serif;

  --shadow-card: 0 1px 2px rgba(32, 30, 29, 0.04), 0 8px 24px rgba(32, 30, 29, 0.06);
  --max-width: 1120px;
}

/* Theme-aware surfaces: defaults to the mobile app's light palette, follows
   system dark preference, and can be pinned either way by the header
   toggle (assets/js/theme.js sets [data-theme] on <html> + localStorage). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --mm-surface: #15181A;
    --mm-surface-muted: #1C2023;
    --mm-text: #F3F1EF;
    --mm-text-muted: #ABA7A5;
    --mm-text-faint: #65605E;
    --mm-primary-tint: #0A2F3A;
    --mm-ink2-tint: #35101E;
    --mm-ink3-tint: #332A06;
    --mm-ink4-tint: #2A2828;
    --mm-primary-deep: #8AD8F0;
    --mm-ink2-deep: #FFA6C6;
    --mm-ink3-deep: #F4D45F;
    --mm-ink4-deep: #DAD6D6;
    --mm-border: #33302F;
    --mm-track-inactive: #2A2827;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

:root[data-theme="dark"] {
  --mm-surface: #15181A;
  --mm-surface-muted: #1C2023;
  --mm-text: #F3F1EF;
  --mm-text-muted: #ABA7A5;
  --mm-text-faint: #65605E;
  --mm-primary-tint: #0A2F3A;
  --mm-ink2-tint: #35101E;
  --mm-ink3-tint: #332A06;
  --mm-ink4-tint: #2A2828;
  --mm-primary-deep: #8AD8F0;
  --mm-ink2-deep: #FFA6C6;
  --mm-ink3-deep: #F4D45F;
  --mm-ink4-deep: #DAD6D6;
  --mm-border: #33302F;
  --mm-track-inactive: #2A2827;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
}

body {
  transition: background-color 0.2s ease, color 0.2s ease;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--mm-surface);
  color: var(--mm-text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--mm-text);
  margin: 0 0 0.4em;
}

a {
  color: var(--mm-primary);
  text-decoration: none;
}

img, svg {
  max-width: 100%;
}

p {
  margin: 0 0 1em;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

/* ---------------------------------------------------------------------- */
/* Header / nav                                                           */
/* ---------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--mm-surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--mm-border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: var(--sp-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 18px;
  color: var(--mm-text);
}

.brand .logo-tile {
  width: 32px;
  height: 32px;
  border-radius: var(--r-logo-small);
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  font-weight: 600;
  font-size: 14.5px;
}

.main-nav a {
  color: var(--mm-text-muted);
}

.main-nav a.active,
.main-nav a:hover {
  color: var(--mm-primary);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--mm-primary);
  color: #fff !important;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}

.header-cta:hover {
  background: var(--mm-primary-mid);
}

.theme-toggle {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  border: 1px solid var(--mm-border);
  background: var(--mm-surface);
  color: var(--mm-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--mm-primary);
  color: var(--mm-primary);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ---------------------------------------------------------------------- */
/* Buttons                                                                */
/* ---------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15.5px;
  border-radius: var(--r-field);
  padding: 13px 24px;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  line-height: 1.2;
}

.btn-primary {
  background: var(--mm-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--mm-primary-mid);
}

.btn-outline {
  background: transparent;
  border-color: var(--mm-border);
  color: var(--mm-text);
}

.btn-outline:hover {
  border-color: var(--mm-primary);
  color: var(--mm-primary);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 16px 28px;
  font-size: 16.5px;
}

/* ---------------------------------------------------------------------- */
/* Badges / chips / pills                                                 */
/* ---------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--mm-primary-tint);
  color: var(--mm-primary-deep);
  border: 0.5px solid var(--mm-primary);
}

.badge.ink2 { background: var(--mm-ink2-tint); color: var(--mm-ink2-deep); border-color: var(--mm-ink2); }
.badge.ink3 { background: var(--mm-ink3-tint); color: var(--mm-ink3-deep); border-color: var(--mm-ink3); }
.badge.ink4 { background: var(--mm-ink4-tint); color: var(--mm-ink4-deep); border-color: var(--mm-ink4); }

.section-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mm-text-muted);
}

/* ---------------------------------------------------------------------- */
/* Icon tiles (ink-colored initials, mirrors MMInk rotation)              */
/* ---------------------------------------------------------------------- */

.ink-tile {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: var(--r-icon-tile);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 17px;
}

.ink-0 { background: var(--mm-primary-tint); color: var(--mm-primary-deep); }
.ink-1 { background: var(--mm-ink2-tint); color: var(--mm-ink2-deep); }
.ink-2 { background: var(--mm-ink3-tint); color: var(--mm-ink3-deep); }
.ink-3 { background: var(--mm-ink4-tint); color: var(--mm-ink4-deep); }

/* ---------------------------------------------------------------------- */
/* Cards / list rows                                                     */
/* ---------------------------------------------------------------------- */

.card {
  background: var(--mm-surface);
  border: 1px solid var(--mm-border);
  border-radius: var(--r-list-row);
  padding: var(--sp-4);
}

.card-shadow {
  border-color: transparent;
  box-shadow: var(--shadow-card);
}

.row-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--mm-border);
  border-radius: var(--r-list-row);
  color: var(--mm-text);
  background: var(--mm-surface);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.row-link:hover {
  border-color: var(--mm-primary);
  transform: translateY(-1px);
}

.row-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  margin: 0;
}

.row-sub {
  font-size: 12.5px;
  color: var(--mm-text-muted);
  margin-top: 2px;
}

.row-arrow {
  margin-left: auto;
  color: var(--mm-text-faint);
  flex-shrink: 0;
}

.grid {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* ---------------------------------------------------------------------- */
/* Hero / sections                                                       */
/* ---------------------------------------------------------------------- */

.hero {
  padding: 72px 0 56px;
  background: linear-gradient(180deg, var(--mm-primary-tint) 0%, var(--mm-surface) 100%);
  border-bottom: 1px solid var(--mm-border);
}

/* Flat background in dark mode — the light-mode gradient (tint -> surface)
   reads as a muddy band once the tint is a dark teal instead. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero {
    background: var(--mm-surface);
  }
}

:root[data-theme="dark"] .hero {
  background: var(--mm-surface);
}

.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--sp-8);
  align-items: center;
}

.hero h1 {
  font-size: clamp(32px, 4.2vw, 48px);
  line-height: 1.05;
}

.hero p.lead {
  font-size: 17px;
  color: var(--mm-text-muted);
  max-width: 480px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: var(--sp-4);
}

.hero-art {
  display: flex;
  justify-content: center;
}

.phone-frame {
  width: min(300px, 82vw);
  background: var(--mm-text);
  border-radius: 26px;
  box-shadow: var(--shadow-card);
  padding: 12px;
}

.phone-frame .phone-screen-wrap {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  background: var(--mm-surface);
  line-height: 0;
}

/* Sized to the screenshot's own aspect ratio (not forced/cropped into a
   generic phone ratio) so nothing gets cut off at the edges. */
.phone-frame .phone-screen {
  display: block;
  width: 100%;
  height: auto;
}

.phone-frame .phone-screen-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .phone-frame .phone-screen-light { display: none; }
  :root:not([data-theme="light"]) .phone-frame .phone-screen-dark { display: block; }
}

:root[data-theme="dark"] .phone-frame .phone-screen-light { display: none; }
:root[data-theme="dark"] .phone-frame .phone-screen-dark { display: block; }
:root[data-theme="light"] .phone-frame .phone-screen-light { display: block; }
:root[data-theme="light"] .phone-frame .phone-screen-dark { display: none; }

section {
  padding: 56px 0;
}

section.muted {
  background: var(--mm-surface-muted);
  border-top: 1px solid var(--mm-border);
  border-bottom: 1px solid var(--mm-border);
}

.section-head {
  max-width: 640px;
  margin: 0 0 var(--sp-6);
}

.section-head h2 {
  font-size: clamp(24px, 3vw, 32px);
}

.section-head p {
  color: var(--mm-text-muted);
  font-size: 15.5px;
}

.feature-grid {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: repeat(3, 1fr);
}

.feature-card {
  background: var(--mm-surface);
  border: 1px solid var(--mm-border);
  border-radius: var(--r-field);
  padding: var(--sp-4);
}

.feature-card .ink-tile {
  margin-bottom: var(--sp-3);
}

.feature-card h3 {
  font-size: 17px;
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 14px;
  color: var(--mm-text-muted);
  margin: 0;
}

/* Landing: numbers strip, long-form copy, FAQ */

.feature-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.feature-card ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--mm-text-muted);
}

.stat-grid {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  margin-top: var(--sp-6);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-3);
  background: var(--mm-primary-tint);
  border-radius: var(--r-field);
}

.stat-num {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--mm-primary-deep);
}

.stat-label {
  font-size: 13.5px;
  color: var(--mm-text-muted);
}

.prose {
  max-width: 720px;
}

.prose p {
  font-size: 16px;
  line-height: 1.7;
  margin: 0 0 var(--sp-3);
}

.prose h2 {
  font-size: 22px;
  margin: var(--sp-8) 0 var(--sp-2);
}

.prose ul {
  margin: 0 0 var(--sp-3);
  padding-left: 20px;
  line-height: 1.7;
}

.prose .faq {
  max-width: none;
}

.seo-copy {
  margin-top: var(--sp-8);
}

.faq {
  display: grid;
  gap: var(--sp-3);
  max-width: 760px;
}

.faq-item {
  background: var(--mm-surface);
  border: 1px solid var(--mm-border);
  border-radius: var(--r-field);
  padding: var(--sp-4);
}

.faq-item h3 {
  font-size: 17px;
  margin-bottom: 6px;
}

.faq-item p {
  font-size: 14.5px;
  color: var(--mm-text-muted);
  margin: 0;
}

/* ---------------------------------------------------------------------- */
/* Store badges                                                          */
/* ---------------------------------------------------------------------- */

.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  /* Fixed dark/white regardless of site theme — these mimic the real
     App Store / Google Play badges, which don't invert in dark mode. */
  background: #161616;
  color: #fff;
  border-radius: var(--r-field);
  padding: 9px 18px 9px 14px;
  min-width: 170px;
  border: 1px solid #2c2c2c;
}

.store-badge svg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.store-badge .store-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.store-badge .store-copy small {
  font-size: 10px;
  opacity: 0.75;
}

.store-badge .store-copy span {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
}

/* ---------------------------------------------------------------------- */
/* App shell (/app pages)                                                */
/* ---------------------------------------------------------------------- */

.app-topbar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) 0;
}

.app-topbar h1 {
  font-size: 19px;
  margin: 0;
}

.back-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r-field);
  border: 1px solid var(--mm-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--mm-text);
  flex-shrink: 0;
}

/* The icon is a viewBox-only SVG with no intrinsic size; without explicit
   dimensions some browsers (Safari/Firefox) collapse it to nothing. */
.back-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.row-arrow svg {
  width: 20px;
  height: 20px;
  display: block;
}

.breadcrumbs {
  font-size: 12.5px;
  color: var(--mm-text-muted);
  margin-bottom: var(--sp-2);
}

.breadcrumbs a {
  color: var(--mm-text-muted);
}

.breadcrumbs a:hover {
  color: var(--mm-primary);
}

.app-shell {
  min-height: 70vh;
  padding-bottom: 80px;
}

/* Demo lock / upsell panel used on exam & faculty detail pages */

.demo-lock {
  position: relative;
  border: 1px dashed var(--mm-border);
  border-radius: var(--r-field);
  background: var(--mm-surface-muted);
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
  margin: var(--sp-6) 0;
  overflow: hidden;
}

.demo-lock .lock-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--mm-primary-tint);
  color: var(--mm-primary-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.demo-lock h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

.demo-lock p {
  font-size: 14px;
  color: var(--mm-text-muted);
  margin: 0 auto 18px;
  max-width: 420px;
}

.blurred-sample {
  filter: blur(6px);
  user-select: none;
  pointer-events: none;
  opacity: 0.7;
}

/* Question preview cards */

.question-card {
  border: 1px solid var(--mm-border);
  border-radius: var(--r-field);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
  background: var(--mm-surface);
}

.question-card .q-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.question-card .q-number {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 13px;
  color: var(--mm-primary-deep);
  background: var(--mm-primary-tint);
  border-radius: var(--r-pill);
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.question-card .q-text {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}

.q-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.q-option {
  border: 1px solid var(--mm-border);
  border-radius: var(--r-list-row);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--mm-text-muted);
}

.q-input-placeholder {
  border: 1px solid var(--mm-border);
  border-radius: var(--r-list-row);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--mm-text-faint);
  font-style: italic;
}

.info-block {
  background: var(--mm-primary-tint);
  border-radius: var(--r-field);
  padding: var(--sp-4);
  color: var(--mm-primary-deep);
  font-size: 14px;
  margin-bottom: var(--sp-3);
}

/* Smart search demo */

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--mm-border);
  border-radius: var(--r-field);
  padding: 12px var(--sp-3);
  background: var(--mm-surface);
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 15px;
  background: transparent;
  color: var(--mm-text);
}

.search-steps {
  margin-top: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--mm-text-faint);
  opacity: 0.4;
  transition: opacity 0.25s ease, color 0.25s ease;
}

.search-step.active {
  color: var(--mm-text);
  opacity: 1;
}

.search-step.done {
  color: var(--mm-primary);
  opacity: 1;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--mm-border);
  border-top-color: var(--mm-primary);
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Redirect / open-in-app bridge pages */

.bridge-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
}

.bridge-card {
  max-width: 440px;
  width: 100%;
  text-align: center;
  padding: var(--sp-8) var(--sp-6);
}

.bridge-card .logo-tile {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--sp-4);
}

.bridge-card h1 {
  font-size: 22px;
}

.bridge-card p {
  color: var(--mm-text-muted);
  font-size: 14.5px;
}

.fallback-note {
  border: 1px solid var(--mm-border);
  border-radius: var(--r-field);
  padding: var(--sp-4);
  margin-top: var(--sp-4);
  background: var(--mm-surface-muted);
  text-align: left;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.fallback-note.active {
  border-color: var(--mm-primary);
  box-shadow: 0 0 0 3px var(--mm-primary-tint);
}

.fallback-note p {
  font-size: 13.5px;
  color: var(--mm-text-muted);
  margin-bottom: 10px;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--mm-border);
  background: var(--mm-surface-muted);
  padding: 48px 0 28px;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-6);
  flex-wrap: wrap;
}

.footer-cols {
  display: flex;
  gap: var(--sp-8);
  flex-wrap: wrap;
}

.footer-col h4 {
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mm-text-muted);
  margin-bottom: 10px;
}

.footer-col a {
  display: block;
  color: var(--mm-text);
  font-size: 14px;
  margin-bottom: 8px;
}

.footer-col a:hover {
  color: var(--mm-primary);
}

.footer-bottom {
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--mm-border);
  font-size: 12.5px;
  color: var(--mm-text-faint);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------------------------------------------------------------------- */
/* Exams: subject picker (/app/ispiti) and year picker (/app/ispiti/<subject>) */
/* ---------------------------------------------------------------------- */

.page-lead {
  max-width: 640px;
  color: var(--mm-text-muted);
  margin: 0 0 var(--sp-6);
}

.subject-cards {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

.subject-card {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-4);
  border: 1px solid var(--mm-border);
  border-radius: 14px;
  background: var(--mm-surface);
  color: var(--mm-text);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.subject-card:hover {
  border-color: var(--mm-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

.subject-card .row-title {
  font-size: 19px;
}

.subject-tile {
  width: 56px;
  height: 56px;
  min-width: 56px;
  font-size: 19px;
  border-radius: 14px;
}

.year-list {
  display: flex;
  flex-direction: column;
  max-width: 720px;
  border: 1px solid var(--mm-border);
  border-radius: 14px;
  background: var(--mm-surface);
  overflow: hidden;
}

.year-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: 12px var(--sp-4);
}

.year-row + .year-row {
  border-top: 1px solid var(--mm-border);
}

.year-label {
  width: 64px;
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 20px;
}

.term-btns {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.term-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 10px 36px 10px 14px;
  border-radius: var(--r-field);
  border: 1px solid transparent;
  background: var(--mm-primary-tint);
  color: var(--mm-primary-deep);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.term-btn.term-jesen {
  background: var(--mm-ink3-tint);
  color: var(--mm-ink3-deep);
}

a.term-btn:hover {
  border-color: currentColor;
  transform: translateY(-1px);
}

.term-btn .row-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: currentColor;
  opacity: 0.6;
  width: 20px;
}

.term-btn.is-empty {
  background: var(--mm-surface-muted);
  color: var(--mm-text-faint);
}

.term-name {
  font-weight: 700;
  font-size: 15px;
}

.term-meta {
  font-size: 12px;
  opacity: 0.8;
}

.exam-source {
  margin: 0 0 var(--sp-4);
  padding: 12px var(--sp-4);
  background: var(--mm-surface);
  border: 1px solid var(--mm-border);
  border-left: 4px solid var(--mm-primary);
  border-radius: var(--r-field);
  color: var(--mm-text);
}

.exam-source .section-label {
  color: var(--mm-primary);
}

.exam-source p {
  margin: 2px 0 0;
  font-size: 15px;
}

.exam-steps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-6);
}

.exam-step {
  flex: 1 1 160px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  border: 1px solid var(--mm-border);
  border-radius: var(--r-field);
  background: var(--mm-surface);
  color: var(--mm-text);
  transition: border-color 0.15s ease;
}

.exam-step:hover {
  border-color: var(--mm-primary);
}

.exam-step.is-next {
  text-align: right;
}

.exam-step.is-all {
  order: 3;
  flex-basis: 100%;
}

.exam-step .term-meta {
  color: var(--mm-text-muted);
  opacity: 1;
}

@media (max-width: 560px) {
  .year-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
}

/* ---------------------------------------------------------------------- */
/* Faculties: search + universities (/app/fakulteti)                      */
/* ---------------------------------------------------------------------- */

.search-bar {
  position: sticky;
  top: 72px;
  z-index: 10;
  display: flex;
  align-items: center;
  max-width: 720px;
  margin: 0 0 var(--sp-2);
  background: var(--mm-surface);
  border: 1.5px solid var(--mm-border);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease;
}

.search-bar:focus-within {
  border-color: var(--mm-primary);
}

.search-icon {
  display: flex;
  padding-left: 18px;
  color: var(--mm-text-muted);
}

.search-icon svg,
.search-clear svg {
  width: 20px;
  height: 20px;
}

.search-input {
  flex: 1;
  min-width: 0;
  padding: 15px 14px;
  border: 0;
  background: transparent;
  color: var(--mm-text);
  font: inherit;
  font-size: 16px; /* >=16px stops iOS Safari zooming on focus */
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.search-input::placeholder {
  color: var(--mm-text-muted);
}

.search-input::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: 10px;
  border: 0;
  border-radius: 50%;
  background: var(--mm-surface-muted);
  color: var(--mm-text-muted);
  cursor: pointer;
}

.search-clear:hover {
  color: var(--mm-text);
}

.search-clear[hidden],
[data-faculty][hidden],
.uni-section[hidden],
.search-empty[hidden] {
  display: none;
}

.search-status {
  min-height: 1.4em;
  margin: 0 0 var(--sp-3) 18px;
  font-size: 13px;
  color: var(--mm-text-muted);
}

.section-heading {
  font-size: 17px;
  margin: 0 0 var(--sp-3);
}

.track-list {
  grid-template-columns: 1fr;
  max-width: 720px;
}

.uni-sections {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  max-width: 720px;
}

.uni-section {
  border: 1px solid var(--mm-border);
  border-radius: 14px;
  background: var(--mm-surface);
  overflow: hidden;
}

.uni-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  list-style: none;
}

.uni-head::-webkit-details-marker {
  display: none;
}

.uni-head h2 {
  font-size: 18px;
  margin: 0;
}

.uni-tile {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 12px;
}

.uni-tile svg {
  width: 24px;
  height: 24px;
}

.uni-chevron {
  margin-left: auto;
  display: flex;
  color: var(--mm-text-faint);
  transition: transform 0.15s ease;
}

.uni-chevron svg {
  width: 20px;
  height: 20px;
}

.uni-section[open] .uni-chevron {
  transform: rotate(90deg);
}

.uni-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: 0 var(--sp-3) var(--sp-3);
}

.search-empty {
  max-width: 720px;
  margin-top: var(--sp-4);
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
  border: 1px dashed var(--mm-border);
  border-radius: 14px;
}

.search-empty h3 {
  margin: 0 0 6px;
}

.search-empty p {
  color: var(--mm-text-muted);
}

/* ---------------------------------------------------------------------- */
/* Responsive                                                             */
/* ---------------------------------------------------------------------- */

@media (max-width: 860px) {
  .hero .container {
    grid-template-columns: 1fr;
  }

  .hero-art {
    order: -1;
  }

  .feature-grid,
  .feature-grid-2 {
    grid-template-columns: 1fr;
  }

  .main-nav {
    display: none;
  }
}

@media (max-width: 560px) {
  .hero {
    padding: 48px 0 40px;
  }

  section {
    padding: 40px 0;
  }

  .footer-grid {
    flex-direction: column;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
