/* Route-specific refinements on top of the shared "Azure" Mini App UI. */

/* Shared language control: available on every Mini App screen and clear of Telegram safe areas. */
.language-switcher {
  position: absolute;
  z-index: 80;
  top: max(10px, env(safe-area-inset-top));
  right: max(20px, calc((100% - 390px) / 2));
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 0 8px;
  color: var(--color-text, #0c1c3d);
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--color-border, #e0e9f8);
  border-radius: 999px;
  box-shadow: var(--shadow-card, 0 6px 18px rgb(15 23 42 / 10%));
  backdrop-filter: blur(12px);
}

.language-switcher span {
  font-size: 13px;
  opacity: .58;
}

.language-switcher select {
  width: auto;
  min-width: 42px;
  min-height: 32px;
  margin: 0;
  padding: 0 16px 0 2px;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0;
  font: 700 12px/1 system-ui, sans-serif;
  letter-spacing: .04em;
}

.language-switcher select:focus-visible {
  outline: 2px solid var(--color-primary, #2563eb);
  outline-offset: 2px;
}

/* Immediate feedback for Telegram WebView navigation, where network transitions can feel inert. */
body::before {
  content: "";
  position: fixed;
  z-index: 120;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #2b6bf3, #1449c6);
  opacity: 0;
  transition: width 4s cubic-bezier(.1, .7, .2, 1), opacity .15s ease;
}

body.page-is-loading::before {
  width: 82%;
  opacity: 1;
}

/* New-student entry: one clear route before any school-account details. */
.entry-top { display: flex; align-items: center; gap: 9px; min-height: 42px; color: var(--color-text-secondary); font-size: 13px; font-weight: 700; }
.entry-logo { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; color: #fff; background: var(--gradient-primary); box-shadow: var(--shadow-float); font-size: 12px; }
.entry-welcome { position: relative; min-height: calc(100dvh - 120px); padding: 54px 4px 24px; overflow: hidden; }
.entry-welcome::before { position: absolute; z-index: -1; top: -150px; right: -150px; width: 340px; height: 340px; border-radius: 50%; background: radial-gradient(circle, #dbeafe 0%, rgba(219,234,254,0) 68%); content: ""; }
.entry-art { position: relative; width: 100%; height: 170px; margin: -34px 0 12px; overflow: hidden; }
.entry-art-glow { position: absolute; top: -190px; left: 50%; width: 330px; max-width: none; transform: translateX(-50%); opacity: .75; }
.entry-art-sphere { position: absolute; z-index: 1; top: 4px; left: 50%; width: 156px; transform: translateX(-50%) rotate(-8deg); filter: drop-shadow(0 17px 20px rgba(37,99,235,.24)); }
.entry-art-crystal { position: absolute; z-index: 2; right: 17%; bottom: 6px; width: 74px; transform: rotate(18deg); filter: drop-shadow(0 12px 14px rgba(30,64,175,.19)); }
.entry-art span { position: absolute; z-index: 3; top: 58px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 28px; font-weight: 850; letter-spacing: -.09em; text-shadow: 0 3px 12px rgba(15,23,42,.22); }
.entry-welcome h1 { max-width: 360px; margin: 0; color: var(--color-text); font-size: clamp(35px, 10vw, 46px); line-height: .98; letter-spacing: -.055em; }
.entry-lead { max-width: 335px; margin: 18px 0 28px; color: var(--color-text-secondary); font-size: 16px; line-height: 1.45; }
.entry-steps { display: flex; align-items: center; gap: 8px; margin: 0 0 28px; color: var(--color-text-secondary); font-size: 11px; font-weight: 650; }
.entry-steps span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.entry-steps b { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; color: var(--color-primary); background: var(--color-primary-soft); font-size: 10px; }
.entry-steps i { width: 100%; max-width: 20px; height: 1px; background: #cdddf7; }
.entry-status { min-height: 20px; margin: 0 0 12px; color: var(--color-text-tertiary); font-size: 12px; text-align: center; }
.entry-actions { display: grid; gap: 12px; }
.entry-primary { display: block; padding: 16px 20px; border-radius: 18px; color: #fff; background: var(--gradient-primary); box-shadow: 0 16px 28px rgba(37,99,235,.24); text-align: left; }
.entry-primary span, .entry-primary small { display: block; }
.entry-primary span { font-size: 17px; font-weight: 800; }
.entry-primary small { margin-top: 3px; color: rgba(255,255,255,.78); font-size: 12px; }
.entry-login { padding: 15px; border: 1px solid var(--color-border); border-radius: 18px; color: var(--color-primary); background: rgba(255,255,255,.8); font-size: 14px; font-weight: 700; text-align: center; }

a.is-navigating {
  pointer-events: none;
  opacity: .58;
}

/* --- student directory & homework ---------------------------------------- */
.student-section-list { padding: 4px 14px; }
.student-list-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 68px; border-bottom: 1px solid var(--color-border); }
.student-list-row:last-child { border-bottom: 0; }
.student-list-row > span:nth-child(2) strong, .student-list-row > span:nth-child(2) small { display: block; }
.student-list-row small { margin-top: 3px; color: var(--color-text-secondary); }
.student-list-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; color: var(--color-primary); background: var(--color-primary-soft); }
.homework-item header { display: flex; align-items: center; gap: 10px; }
.homework-item header > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; color: var(--color-primary); background: var(--color-primary-soft); }
.homework-item header strong, .homework-item header small { display: block; }
.homework-item header small { margin-top: 2px; color: var(--color-text-secondary); }
.homework-item p { color: var(--color-text-secondary); white-space: pre-wrap; }
.student-message-history article { padding: 12px 0; border-top: 1px solid var(--color-border); }
.student-message-history article:first-of-type { margin-top: 8px; }
.student-message-history article header { display: flex; justify-content: space-between; gap: 10px; color: var(--color-text-tertiary); font-size: 11px; }
.student-message-history article p { margin: 7px 0 0; white-space: pre-wrap; }

/* --- teacher cabinet ------------------------------------------------------ */
.teacher-nav{position:sticky;bottom:0;display:grid;grid-template-columns:repeat(4,1fr);gap:4px;margin:0 -16px;padding:8px 10px calc(8px + env(safe-area-inset-bottom));background:rgba(255,255,255,.94);border-top:1px solid var(--color-border);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);}
.teacher-nav a{display:flex;flex-direction:column;align-items:center;gap:2px;padding:6px 2px;border-radius:12px;font-size:12px;color:var(--color-text-secondary);text-decoration:none;min-height:44px;justify-content:center;}
.teacher-nav a.active{background:var(--color-primary-soft);color:var(--color-primary);font-weight:600;}
.next-lesson .button-like{display:inline-block;margin-top:8px;padding:10px 14px;border-radius:14px;background:var(--gradient-primary);color:#fff;text-decoration:none;font-weight:600;box-shadow:var(--shadow-float);}
.progress{width:100%;height:6px;margin-bottom:8px;border-radius:99px;background:var(--color-surface-alt);}
.progress::-webkit-progress-bar{background:var(--color-surface-alt);border-radius:99px;}
.progress::-webkit-progress-value{background:var(--gradient-primary);border-radius:99px;}
.attendance-form{display:flex;flex-wrap:wrap;gap:6px;}
button[disabled][aria-disabled="true"]{opacity:.5;}
.notification-button i.has-unread{background:var(--color-danger);}
.notification-list article{border-left:3px solid transparent;padding-left:10px;}
.notification-list article.unread{border-left-color:var(--color-primary);}
