/* Egyetem+ — világos, vidám, fehér-türkiz stílus */
:root {
  --turq-50: #effcfd;
  --turq-100: #d5f6f8;
  --turq-200: #a9ebf0;
  --turq-300: #6fdae3;
  --turq-400: #2ec5d3;
  --turq-500: #0fb0c0;
  --turq-600: #0a95a4;
  --turq-700: #0b7783;
  --ink: #12333a;
  --muted: #5d7b82;
  --line: #d9ebee;
  --bg: #f4fbfc;
  --card: #ffffff;
  --sun: #ffc94d;
  --sun-soft: #fff4d1;
  --coral: #ff7a6b;
  --coral-soft: #ffe4e0;
  --green: #22b784;
  --green-soft: #d9f6ea;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(15, 176, 192, 0.10), 0 1px 2px rgba(18, 51, 58, 0.06);
  --shadow-lg: 0 12px 40px rgba(15, 176, 192, 0.18);
  --font: "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.7rem; font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .75em; }
a { color: var(--turq-600); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }

/* Ikonok */
.icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -0.2em; }

/* ---------- Logó ---------- */
.logo { display: inline-flex; align-items: center; gap: .45rem; font-weight: 800; font-size: 1.35rem;
  color: var(--ink); letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo .plus { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: var(--turq-500); color: #fff; font-size: 1.3rem; line-height: 1; padding-bottom: 2px; }
.logo.big { font-size: 2rem; }
.logo.big .plus { width: 2.3rem; height: 2.3rem; font-size: 1.8rem; }

/* ---------- Felső sáv ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 1.5rem; padding: .6rem 1.25rem; }
.topbar nav { display: flex; gap: .25rem; flex: 1; }
.topbar nav a { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .9rem; border-radius: 999px;
  color: var(--muted); font-weight: 700; }
.topbar nav a:hover { background: var(--turq-50); text-decoration: none; color: var(--turq-700); }
.topbar nav a.active { background: var(--turq-100); color: var(--turq-700); }
.userbox { display: flex; align-items: center; gap: .5rem; }
.userbox .name { font-weight: 700; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.demo-banner { background: var(--sun-soft); color: #7a5a00; text-align: center; padding: .4rem 1rem; font-size: .875rem;
  border-bottom: 1px solid #f3e0a1; }

main { max-width: 1080px; margin: 0 auto; padding: 1.5rem 1.25rem 5rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }

/* ---------- Kártyák, rácsok ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.card.flat { box-shadow: none; }
.grid { display: grid; gap: 1rem; }
.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); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

.hero { background: linear-gradient(135deg, var(--turq-500), var(--turq-300)); color: #fff; border-radius: 24px;
  padding: 1.5rem 1.75rem; display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; box-shadow: var(--shadow-lg); }
.hero h1 { color: #fff; margin-bottom: .25rem; }
.hero p { margin: 0; opacity: .95; }

.stat { text-align: left; }
.stat .num { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-weight: 600; font-size: .9rem; }
.stat.good .num { color: var(--green); }
.stat.blue .num { color: var(--turq-600); }
.stat.sun .num { color: #d99a00; }

/* ---------- Gombok ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 0; cursor: pointer;
  font: inherit; font-weight: 700; padding: .6rem 1.1rem; border-radius: 999px; background: var(--turq-500); color: #fff;
  transition: transform .06s ease, background .15s ease, box-shadow .15s ease; }
.btn:hover { background: var(--turq-600); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: var(--turq-50); color: var(--turq-700); }
.btn.ghost:hover { background: var(--turq-100); }
.btn.outline { background: #fff; color: var(--turq-700); box-shadow: inset 0 0 0 2px var(--turq-200); }
.btn.outline:hover { background: var(--turq-50); }
.btn.white { background: #fff; color: var(--turq-700); }
.btn.white:hover { background: var(--turq-50); }
.btn.danger { background: var(--coral-soft); color: #c0392b; }
.btn.danger:hover { background: #ffd1ca; }
.btn.sm { padding: .3rem .7rem; font-size: .875rem; }
.btn.icon-only { padding: .4rem; width: 2rem; height: 2rem; }
.btn.block { width: 100%; }

/* ---------- Űrlapok ---------- */
label.field { display: block; margin-bottom: .9rem; }
label.field > span { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .25rem; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: .8rem; margin-top: .2rem; display: block; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: .55rem .8rem;
  transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--turq-400); box-shadow: 0 0 0 4px var(--turq-100); }
textarea { resize: vertical; min-height: 80px; }
.check { display: flex; align-items: center; gap: .55rem; font-weight: 600; margin-bottom: .9rem; cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--turq-500); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.form-error { background: var(--coral-soft); color: #b3321f; border-radius: 12px; padding: .6rem .9rem; margin-bottom: .9rem; font-weight: 600; }
.form-ok { background: var(--green-soft); color: #11775a; border-radius: 12px; padding: .6rem .9rem; margin-bottom: .9rem; font-weight: 600; }

/* ---------- Címkék, avatar ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700;
  background: var(--turq-100); color: var(--turq-700); white-space: nowrap; }
.badge.planned { background: #eaf0f1; color: #4c666c; }
.badge.enrolled { background: var(--turq-100); color: var(--turq-700); }
.badge.completed { background: var(--green-soft); color: #11775a; }
.badge.failed { background: var(--coral-soft); color: #b3321f; }
.badge.sun { background: var(--sun-soft); color: #7a5a00; }
.avatar { width: 2.2rem; height: 2.2rem; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--turq-200); color: var(--turq-700); font-weight: 800; font-size: .85rem; }
.avatar.sm { width: 1.6rem; height: 1.6rem; font-size: .7rem; }
.avatar.c1 { background: #ffe2a8; color: #7a5200; }
.avatar.c2 { background: #ffd0ca; color: #a02f20; }
.avatar.c3 { background: #cdeedd; color: #136e4f; }
.avatar.c4 { background: #d9d5ff; color: #43399a; }

/* ---------- Tárgyak ---------- */
.semester { margin-bottom: 1.5rem; }
.semester-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.semester-head h2 { margin: 0; }
.course { display: flex; align-items: center; gap: 1rem; padding: .8rem 1rem; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; margin-bottom: .5rem; }
.course .cr { font-weight: 800; color: var(--turq-600); min-width: 3.2rem; text-align: center; font-size: 1.1rem; line-height: 1.1; }
.course .cr small { display: block; font-size: .65rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.course .title { font-weight: 700; }
.course .meta { color: var(--muted); font-size: .85rem; }
.grade { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--green-soft); color: #11775a; }
.grade.g1 { background: var(--coral-soft); color: #b3321f; }

.donut-wrap { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.donut { position: relative; width: 140px; height: 140px; flex: none; }
.donut svg { transform: rotate(-90deg); }
.donut .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut .center b { font-size: 1.7rem; line-height: 1; }
.donut .center span { font-size: .75rem; color: var(--muted); font-weight: 600; }
.legend { display: grid; gap: .35rem; font-size: .9rem; }
.legend i { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; margin-right: .45rem; vertical-align: -1px; }
.bar { height: 10px; border-radius: 999px; background: var(--turq-100); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--turq-500); border-radius: 999px; }

/* ---------- Csoportok ---------- */
.group-card { display: block; color: inherit; transition: transform .12s ease, box-shadow .12s ease; }
.group-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; }
.group-card h3 { margin-bottom: .3rem; }
.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--line); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs button { background: none; border: 0; font: inherit; font-weight: 700; padding: .6rem 1rem; color: var(--muted); cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -2px; display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.tabs button:hover { color: var(--turq-700); }
.tabs button.active { color: var(--turq-700); border-bottom-color: var(--turq-500); }

.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; align-items: start; }
.col { background: var(--turq-50); border-radius: var(--radius); padding: .75rem; min-height: 120px; }
.col-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; padding: .25rem .4rem .6rem; }
.col-head .count { background: #fff; border-radius: 999px; padding: 0 .55rem; font-size: .8rem; color: var(--muted); }
.task { background: #fff; border-radius: 12px; padding: .7rem .8rem; margin-bottom: .6rem; box-shadow: var(--shadow); }
.task .t { font-weight: 700; word-break: break-word; }
.task .d { color: var(--muted); font-size: .85rem; margin: .2rem 0; word-break: break-word; }
.task .foot { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin-top: .5rem; flex-wrap: wrap; }
.task .acts { display: flex; gap: .2rem; }
.due { font-size: .78rem; font-weight: 700; color: var(--muted); }
.due.late { color: #c0392b; }
.col.done .task .t { text-decoration: line-through; color: var(--muted); }

.chat { display: flex; flex-direction: column; height: min(62vh, 560px); }
.chat-log { flex: 1; overflow-y: auto; padding: .5rem .25rem; display: flex; flex-direction: column; gap: .5rem; }
.msg { max-width: 78%; align-self: flex-start; }
.msg .who { font-size: .75rem; color: var(--muted); font-weight: 700; margin: 0 .5rem .1rem; }
.msg .bubble { background: var(--turq-50); border: 1px solid var(--line); padding: .5rem .85rem; border-radius: 16px 16px 16px 4px;
  white-space: pre-wrap; word-break: break-word; }
.msg.me { align-self: flex-end; }
.msg.me .who { text-align: right; }
.msg.me .bubble { background: var(--turq-500); color: #fff; border-color: var(--turq-500); border-radius: 16px 16px 4px 16px; }
.chat-form { display: flex; gap: .5rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; }
.day-sep { align-self: center; font-size: .75rem; color: var(--muted); font-weight: 700; background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: .1rem .7rem; }

.file { display: flex; align-items: center; gap: .8rem; padding: .7rem .2rem; border-bottom: 1px solid var(--line); }
.file:last-child { border-bottom: 0; }
.file .ficon { width: 2.2rem; height: 2.2rem; border-radius: 10px; background: var(--turq-100); color: var(--turq-700); display: grid; place-items: center; }

.member { display: flex; align-items: center; gap: .8rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.member:last-child { border-bottom: 0; }

.invite-box { background: var(--turq-50); border: 2px dashed var(--turq-300); border-radius: 14px; padding: .8rem 1rem; }
.invite-box code { font-size: 1.4rem; font-weight: 800; letter-spacing: .15em; color: var(--turq-700); }
.copyline { display: flex; gap: .5rem; align-items: center; }
.copyline input { flex: 1; }

.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty .big { font-size: 2.2rem; }

/* ---------- Modal, toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(18, 51, 58, .45); display: grid; place-items: center; padding: 1rem; z-index: 50;
  animation: fade .15s ease; }
.modal { background: #fff; border-radius: 22px; width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1.1rem 1.4rem .2rem; }
.modal-head h2 { margin: 0; }
.modal-body { padding: .8rem 1.4rem 1.4rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .5rem; }
.toasts { position: fixed; bottom: 5rem; left: 50%; transform: translateX(-50%); display: grid; gap: .5rem; z-index: 60; width: min(92vw, 420px); }
.toast { background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: 14px; box-shadow: var(--shadow-lg); font-weight: 600; animation: pop .2s ease; }
.toast.ok { background: var(--turq-700); }
.toast.err { background: #b3321f; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
.spinner { width: 28px; height: 28px; border: 4px solid var(--turq-100); border-top-color: var(--turq-500); border-radius: 50%;
  animation: spin .8s linear infinite; margin: 3rem auto; }
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------- Belépő oldal ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { background: linear-gradient(160deg, var(--turq-500) 0%, var(--turq-300) 100%); color: #fff; padding: 3rem; display: flex;
  flex-direction: column; justify-content: center; gap: 1.5rem; position: relative; overflow: hidden; }
.auth-hero .logo { color: #fff; }
.auth-hero .logo .plus { background: #fff; color: var(--turq-500); }
.auth-hero h1 { font-size: 2.3rem; color: #fff; }
.auth-hero ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; font-size: 1.05rem; font-weight: 600; }
.auth-hero li { display: flex; gap: .7rem; align-items: center; }
.auth-hero li .dot { width: 2rem; height: 2rem; border-radius: 50%; background: rgba(255,255,255,.25); display: grid; place-items: center; flex: none; }
.auth-hero .bubble { position: absolute; border-radius: 50%; background: rgba(255,255,255,.14); }
.auth-form { display: grid; place-items: center; padding: 2rem 1.25rem; background: #fff; }
.auth-box { width: 100%; max-width: 400px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--turq-50); border-radius: 999px; padding: 4px; margin-bottom: 1.25rem; }
.seg button { border: 0; background: none; font: inherit; font-weight: 700; padding: .5rem; border-radius: 999px; color: var(--muted); cursor: pointer; }
.seg button.active { background: #fff; color: var(--turq-700); box-shadow: var(--shadow); }

/* ---------- Reszponzív ---------- */
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 1.75rem 1.25rem; }
  .auth-hero h1 { font-size: 1.6rem; }
  .auth-hero ul { display: none; }
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .topbar { padding: .5rem .9rem; gap: .75rem; }
  .topbar nav { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); justify-content: space-around;
    padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom)); z-index: 30; gap: 0; }
  .topbar nav a { flex-direction: column; gap: .1rem; font-size: .72rem; padding: .3rem .5rem; border-radius: 12px; }
  .topbar nav a .icon { width: 1.5em; height: 1.5em; }
  .userbox .name { display: none; }
  .toasts { bottom: 5.5rem; }
  .form-row { grid-template-columns: 1fr; }
  .msg { max-width: 92%; }
}
@media (max-width: 480px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr 1fr; }
  main { padding: 1rem .9rem 6rem; }
  .hero { padding: 1.25rem; }
}
