/*
 * student-online.net — design system
 * A clean, modern, accessible identity for a worldwide student platform.
 * Copyright 2026 ITTH GmbH & Co. KG
 */

:root {
  --brand: #4f46e5;
  --logo: #4f46e5;
  --brand-600: #4338ca;
  --brand-700: #3730a3;
  --brand-soft: #eef2ff;
  --accent: #f59e0b;
  --accent-soft: #fef3c7;
  --teal: #0d9488;

  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-card: #ffffff;
  --danger: #e11d48;
  --success: #059669;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, .25);
  --maxw: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8edf5;
    --logo: #818cf8;
    --ink-soft: #c2cbd9;
    --muted: #93a0b4;
    --line: #233045;
    --bg: #0b1120;
    --bg-soft: #0f172a;
    --bg-card: #131c2e;
    --brand-soft: #1c2541;
    --accent-soft: #3a2f12;
    --shadow: 0 12px 32px -14px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.2; color: var(--ink); font-weight: 750; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); margin: .2em 0 .4em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.2rem; }
p { color: var(--ink-soft); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 56px 0; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- Header / navigation ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.12rem; color: var(--ink); letter-spacing: -.03em; }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 34px; height: 34px; display: grid; place-items: center; color: var(--logo);
}
.brand .logo svg { width: 34px; height: 34px; display: block; }
.brand .wordmark { white-space: nowrap; }
.brand b { color: var(--logo); }
.fld { padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-card); color: var(--ink); font-size: .95rem; }
.mapfilter { display: flex; align-items: center; gap: 7px; font-size: .9rem; color: var(--muted); cursor: pointer; }

.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav-links a {
  color: var(--ink-soft); font-weight: 600; font-size: .95rem;
  padding: 8px 12px; border-radius: 9px; white-space: nowrap;
}
.nav-links a:hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }
.nav-links a.active { color: var(--brand); background: var(--brand-soft); }
.nav-spacer { flex: 1; }

.nav-actions { display: flex; align-items: center; gap: 8px; }

.lang-switch { position: relative; }
.lang-switch summary {
  list-style: none; cursor: pointer; padding: 7px 11px; border-radius: 9px;
  border: 1px solid var(--line); font-weight: 600; font-size: .9rem; color: var(--ink-soft);
  display: flex; align-items: center; gap: 6px;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-menu {
  position: absolute; right: 0; top: 44px; background: var(--bg-card);
  border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 6px; min-width: 168px;
}
.lang-menu a { display: block; padding: 8px 12px; border-radius: 7px; color: var(--ink-soft); font-weight: 600; font-size: .9rem; }
.lang-menu a:hover { background: var(--bg-soft); text-decoration: none; }
.lang-menu a.active { color: var(--brand); background: var(--brand-soft); }

.menu-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 18px; border-radius: 10px; font-weight: 650; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; transition: transform .04s ease, background .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-accent { background: var(--accent); color: #3a2a00; }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--ink); }
.btn-sm { padding: 6px 12px; font-size: .85rem; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto -10%; height: 480px;
  background: radial-gradient(600px 280px at 20% 20%, color-mix(in srgb, var(--brand) 24%, transparent), transparent 70%),
              radial-gradient(560px 280px at 85% 10%, color-mix(in srgb, var(--teal) 22%, transparent), transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; padding: 72px 0 60px; max-width: 760px; }
.hero .eyebrow { color: var(--brand); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: .8rem; }
.hero p.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 640px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

/* ---------- Search box ---------- */
.searchbar { display: flex; gap: 8px; margin-top: 26px; max-width: 620px; }
.searchbar input[type=search], .searchbar input[type=text] {
  flex: 1; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line);
  font-size: 1rem; background: var(--bg-card); color: var(--ink); box-shadow: var(--shadow-sm);
}
.searchbar input:focus { outline: 3px solid color-mix(in srgb, var(--brand) 30%, transparent); border-color: var(--brand); }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
a.card { color: inherit; display: block; }
a.card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.card .ic { width: 42px; height: 42px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 14px; font-size: 1.3rem; }
.card h3 { margin: 0 0 6px; }
.card p { margin: 0; font-size: .95rem; }
.card .flag { font-size: 1.7rem; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-700); font-size: .78rem; font-weight: 650; }
.pill.accent { background: var(--accent-soft); color: #92500e; }
.pill.teal { background: color-mix(in srgb, var(--teal) 16%, transparent); color: var(--teal); }

.stat { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 30px; }
.stat .n { font-size: 1.9rem; font-weight: 800; color: var(--ink); letter-spacing: -.03em; }
.stat .l { color: var(--muted); font-size: .9rem; }

/* ---------- Forms / panels ---------- */
.panel { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-weight: 650; font-size: .9rem; margin-bottom: 6px; color: var(--ink-soft); }
.form-row input, .form-row textarea, .form-row select {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font-size: 1rem; font-family: inherit;
}
.form-row input:focus, .form-row textarea:focus { outline: 3px solid color-mix(in srgb, var(--brand) 26%, transparent); border-color: var(--brand); }
.field-error { color: var(--danger); font-size: .84rem; margin-top: 5px; }
.alert { padding: 12px 15px; border-radius: 10px; font-size: .92rem; margin-bottom: 16px; border: 1px solid; }
.alert-success { background: color-mix(in srgb, var(--success) 12%, transparent); border-color: color-mix(in srgb, var(--success) 40%, transparent); color: var(--success); }
.alert-error { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.auth-wrap { max-width: 440px; margin: 48px auto; }

/* ---------- Dictionary ---------- */
.dict-tabs { display: inline-flex; gap: 4px; background: var(--bg-soft); padding: 4px; border-radius: 11px; border: 1px solid var(--line); }
.dict-tabs a { padding: 7px 16px; border-radius: 8px; font-weight: 650; font-size: .9rem; color: var(--ink-soft); }
.dict-tabs a.active { background: var(--bg-card); color: var(--brand); box-shadow: var(--shadow-sm); }
.dict-tabs a:hover { text-decoration: none; }
.result-table { width: 100%; border-collapse: collapse; margin-top: 22px; }
.result-table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 12px; border-bottom: 2px solid var(--line); }
.result-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.result-table tr:hover td { background: var(--bg-soft); }
.result-table .term { font-weight: 650; color: var(--ink); }
mark { background: var(--accent-soft); color: inherit; padding: 0 2px; border-radius: 3px; }

/* Dictionary console (technical look) + speech/copy controls */
.dict-console { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); margin-top: 18px; }
.dict-form { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.dict-form input[type=search] { flex: 1; min-width: 220px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 1rem; font-family: var(--mono); }
.dict-form input[type=search]:focus { outline: 3px solid color-mix(in srgb, var(--brand) 26%, transparent); border-color: var(--brand); }
.dict-form select { padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-card); color: var(--ink); }
.dict-resultbar { display: flex; align-items: baseline; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
.dict-count { font-size: 1.05rem; }
.dict-chip { display: inline-block; font-size: .64rem; font-weight: 700; letter-spacing: .05em; background: var(--brand-soft); color: var(--brand-700); padding: 2px 6px; border-radius: 5px; margin-right: 4px; font-family: var(--mono); vertical-align: middle; }
.dict-results .term { font-family: var(--mono); }
.row-actions { opacity: 0; display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: middle; transition: opacity .12s ease; }
.result-table tr:hover .row-actions { opacity: 1; }
.iconbtn { background: none; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-size: .78rem; line-height: 1.5; padding: 0 6px; color: var(--muted); }
.iconbtn:hover { background: var(--bg-soft); color: var(--ink); }
@media (hover: none) { .row-actions { opacity: 1; } }

/* Vocabulary trainer */
.vt-card { text-align: center; padding: 40px 24px; }
.vt-prompt { font-size: 2rem; font-weight: 750; letter-spacing: -.02em; }
.vt-answer { font-size: 1.5rem; color: var(--brand); margin-top: 14px; min-height: 1.6em; }
.vt-progress { height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; margin: 16px 0; }
.vt-progress > div { height: 100%; background: linear-gradient(90deg, var(--brand), var(--teal)); width: 0; transition: width .2s ease; }

/* Checklists */
.checklist label { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.checklist input { width: 19px; height: 19px; margin-top: 2px; flex: none; }
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; }
.checklist h3 { margin: 22px 0 4px; }

/* ---------- Article / prose ---------- */
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.6em; padding-top: .3em; border-top: 1px solid var(--line); }
.prose h3 { margin-top: 1.4em; }
.prose img { max-width: 100%; border-radius: var(--radius-sm); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.prose th { background: var(--bg-soft); }
.prose blockquote { border-left: 3px solid var(--brand); margin: 1em 0; padding: .4em 1.1em; color: var(--ink-soft); background: var(--bg-soft); border-radius: 0 8px 8px 0; }
.prose code { font-family: var(--mono); background: var(--bg-soft); padding: 2px 6px; border-radius: 5px; font-size: .9em; }
.toc { font-size: .92rem; }

.layout-2col { display: grid; grid-template-columns: 240px 1fr; gap: 40px; align-items: start; }
.sidebar { position: sticky; top: 84px; }
.sidebar a { display: block; padding: 6px 10px; border-radius: 7px; color: var(--ink-soft); font-size: .92rem; }
.sidebar a:hover { background: var(--bg-soft); text-decoration: none; }
.sidebar a.active { color: var(--brand); background: var(--brand-soft); font-weight: 650; }

/* ---------- Campus / microblog ---------- */
.post { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--teal)); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.post .meta { font-size: .88rem; color: var(--muted); }
.post .meta b { color: var(--ink); }
.post .body { margin: 4px 0 8px; color: var(--ink); white-space: pre-wrap; }
.post .actions { display: flex; gap: 18px; color: var(--muted); font-size: .86rem; }
.post .actions a { color: var(--muted); }
.composer textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 1.05rem; font-family: inherit; resize: vertical; min-height: 84px; background: var(--bg); color: var(--ink); }

/* ---------- Type trainer ---------- */
.trainer-target { font-family: var(--mono); font-size: 1.5rem; line-height: 2.1; letter-spacing: .02em; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; user-select: none; }
.trainer-target .char { color: var(--muted); padding: 1px 0; }
.trainer-target .char.done { color: var(--ink); }
.trainer-target .char.wrong { color: #fff; background: var(--danger); border-radius: 3px; }
.trainer-target .char.current { background: var(--accent-soft); border-radius: 3px; box-shadow: inset 0 -3px 0 var(--accent); }
.trainer-metrics { display: flex; gap: 30px; margin: 20px 0; }
.trainer-metrics .n { font-size: 2rem; font-weight: 800; color: var(--brand); }
.trainer-metrics .l { color: var(--muted); font-size: .85rem; }
.trainer-input { width: 100%; padding: 14px; font-size: 1.1rem; font-family: var(--mono); border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); margin-top: 60px; padding: 48px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 28px; }
.footer-grid h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 12px; }
.footer-grid a { display: block; color: var(--ink-soft); font-size: .92rem; padding: 3px 0; }
.footer-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: .85rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .layout-2col { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}
@media (max-width: 720px) {
  .menu-toggle { display: inline-flex; }
  .nav-links {
    position: fixed; inset: 64px 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--bg-card); border-bottom: 1px solid var(--line); padding: 12px; gap: 2px;
    box-shadow: var(--shadow); transform: translateY(-120%); transition: transform .2s ease; margin: 0;
  }
  .nav-links.open { transform: translateY(0); }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .stat { gap: 18px; }
}
