/* ═══════════════════════════════════════════════════
   TutorBoard — Common Styles
   Светлый studio-стиль (Miro-inspired)
   Шрифт: DM Sans (Google Fonts, non-blocking)
═══════════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  --bg:       #f5f4f0;
  --bg2:      #ffffff;
  --bg3:      #f0efe9;
  --bg4:      #e6e4dc;
  --border:   #e0ddd4;
  --border2:  #ccc9be;

  --text:     #1a1916;
  --text2:    #6b6860;
  --text3:    #a09d96;

  --blue:     #4361ee;
  --blue-lt:  #eef1ff;
  --blue-gl:  rgba(67, 97, 238, .18);
  --teal:     #06b6a2;
  --amber:    #f59e0b;
  --rose:     #f43f5e;
  --green:    #22c55e;
  --violet:   #8b5cf6;

  --sh:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --sh2:  0 4px 12px rgba(0,0,0,.09), 0 1px 3px rgba(0,0,0,.05);
  --sh3:  0 12px 32px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.05);

  --r:  10px;
  --r2: 16px;
  --r3: 20px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }

/* ── Dot background pattern ── */
.dot-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(0,0,0,.06) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: 14px 14px;
  pointer-events: none;
  z-index: 0;
}

/* ── Shared Components ── */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(67, 97, 238, .25);
}
.btn-primary:hover { background: #3451d8; box-shadow: 0 4px 14px rgba(67, 97, 238, .35); }

.btn-secondary {
  background: var(--bg3);
  color: var(--text2);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border2); color: var(--text); }

.btn-danger {
  background: #fff1f2;
  color: var(--rose);
  border: 1.5px solid rgba(244, 63, 94, .2);
}
.btn-danger:hover { background: #ffe4e6; border-color: rgba(244, 63, 94, .4); }

.btn-green {
  background: var(--green);
  color: #fff;
}
.btn-green:hover { background: #16a34a; }

.btn-block { width: 100%; }

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

/* Inputs */
.input {
  width: 100%;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 11px 14px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-gl);
}
.input::placeholder { color: var(--text3); }

/* Labels */
.label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  color: var(--text3);
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* Cards */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  box-shadow: var(--sh3);
  overflow: hidden;
}

/* Overlay / Modal */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(245, 244, 240, .85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.overlay.hide { display: none; }

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast container */
.toast-box {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 10px 22px;
  background: var(--text);
  color: #fff;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  animation: toastIn .3s ease, toastOut .3s ease 2.7s forwards;
  pointer-events: auto;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* Animations */
@keyframes popIn {
  from { opacity: 0; transform: scale(.93) translateY(10px); }
}
@keyframes fadeIn {
  from { opacity: 0; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
}

/* ── Utility ── */
.hide { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text3); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.fw-800 { font-weight: 800; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
