/* ============================================================
   PATH — Language Practice · styles.css
   - Exact multi-layer gradient background (as specified)
   - NO transform on button hover
   - NO outline / focus border anywhere
   - Fully responsive + hamburger menu on small screens
   ============================================================ */

:root {
  --bg-card: rgba(255, 255, 255, .055);
  --bg-card-hover: rgba(255, 255, 255, .09);
  --border: rgba(255, 255, 255, .10);
  --text: #e8eaf0;
  --muted: #9aa3b8;
  --accent: #6a7bff;
  --accent-2: #8a5bff;
  --success: #3ecf8e;
  --danger: #ff6b6b;
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-attachment: fixed;
  background: radial-gradient(120% 80% at 20% 10%, rgb(58, 63, 85) 0%, transparent 45%), radial-gradient(120% 90% at 80% 30%, rgb(42, 45, 61) 0%, transparent 50%), linear-gradient(160deg, rgb(12, 13, 18) 0%, rgb(21, 22, 29) 100%);
}

/* ---------- Remove ALL focus outlines / focus borders ---------- */
a:focus, button:focus, input:focus, select:focus, textarea:focus, [tabindex]:focus,
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
  outline: none;
  outline: 0;
}
::-moz-focus-inner { border: 0; }

/* ---------- Typography ---------- */
h1, h2, h3 { font-family: 'Poppins', 'Inter', sans-serif; font-weight: 700; }
.muted { color: var(--muted); }
.grad-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- Buttons (hover changes color ONLY — no transform) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  font: 600 15px/1 'Inter', sans-serif;
  color: #fff;
  padding: 13px 22px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  letter-spacing: .2px;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover  { background: linear-gradient(135deg, #7d8bff, #9d72ff); }
.btn:active { background: linear-gradient(135deg, #5b6bef, #7d4bef); }
.btn .material-icons { font-size: 19px; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: var(--bg-card-hover); }
.btn-ghost:active { background: var(--bg-card); }

.btn-sm { padding: 9px 16px; font-size: 14px; border-radius: 10px; }
.btn-sm .material-icons { font-size: 17px; }

.btn-success { background: linear-gradient(135deg, #2bb673, #1f9e63); }
.btn-success:hover { background: linear-gradient(135deg, #38c783, #27ad6f); }

.btn-danger { background: linear-gradient(135deg, #ff6b6b, #e04f4f); }
.btn-danger:hover { background: linear-gradient(135deg, #ff7d7d, #e85f5f); }

.btn-block { width: 100%; margin-top: 6px; }

.icon-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: inline-flex;
}
.icon-btn:hover { color: var(--danger); background: var(--bg-card); }
.icon-btn .material-icons { font-size: 19px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12, 13, 18, .72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 13px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 20px 'Poppins', sans-serif;
  color: var(--text);
  text-decoration: none;
  letter-spacing: .5px;
}
.brand .logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.brand .logo .material-icons { font-size: 21px; color: #fff; }

.nav { display: flex; gap: 4px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font: 500 14px 'Inter', sans-serif;
}
.nav a:hover { color: var(--text); background: var(--bg-card); }
.nav a.active-link { color: #fff; background: var(--bg-card-hover); }
.nav a .material-icons { font-size: 19px; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-chip .material-icons { font-size: 22px; color: var(--accent); }

.hamburger {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  place-items: center;
  cursor: pointer;
}
.hamburger .material-icons { font-size: 24px; }

/* ---------- Layout ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 30px 24px 60px; }
.section { display: none; }
.section.active { display: block; }

.hero { margin: 10px 0 26px; }
.hero h1 { font-size: clamp(26px, 4vw, 38px); margin-bottom: 8px; }
.hero p { color: var(--muted); font-size: 16px; }

.section-head { margin: 6px 0 22px; }
.section-head h1 { font-size: clamp(24px, 3.4vw, 32px); margin-bottom: 6px; }
.section-head p { color: var(--muted); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  margin-bottom: 14px;
}
.card-title .material-icons { color: var(--accent); font-size: 21px; }

/* ---------- Dashboard ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.stat-ic {
  font-size: 30px !important;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.ic-blue   { color: #7d8bff !important; background: rgba(106, 123, 255, .14); }
.ic-green  { color: #3ecf8e !important; background: rgba(62, 207, 142, .12); }
.ic-orange { color: #ff9f43 !important; background: rgba(255, 159, 67, .12); }
.ic-purple { color: #b57bff !important; background: rgba(181, 123, 255, .12); }
.stat-value { font: 700 26px 'Poppins', sans-serif; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 2px; }

.goal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.goal-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
}
.goal-head .material-icons { color: var(--accent); font-size: 20px; }
.goal-track {
  height: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  overflow: hidden;
}
.goal-bar {
  height: 100%;
  width: 0;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.recent-list { list-style: none; }
.recent-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  font-size: 14px;
}
.recent-list li:last-child { border-bottom: 0; }
.recent-list .material-icons { font-size: 20px; }
.ic-known { color: var(--success) !important; }
.ic-again { color: var(--danger) !important; }
.recent-word { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-time { color: var(--muted); font-size: 12.5px; flex-shrink: 0; }
.empty { color: var(--muted); padding: 10px 4px; }

.quick-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }

/* ---------- Controls rows / forms ---------- */
.controls-card { padding: 18px 22px; }
.controls-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.controls-row label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
  min-width: 150px;
}
.controls-row label.grow { flex: 1; min-width: 220px; }
.controls-row .btn { margin-bottom: 1px; }

.input {
  width: 100%;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 13px 15px;
  font: 400 15px 'Inter', sans-serif;
}
.input::placeholder { color: rgba(154, 163, 184, .65); }
select.input { cursor: pointer; }
select.input option { background: #15161d; color: var(--text); }

.input-icon-wrap { position: relative; }
.input.has-ic { padding-left: 44px; }
.input-ic {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--muted);
  pointer-events: none;
}

.field-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 14px 0 7px;
}
.form-card form label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 14px 0 7px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  padding: 12px 15px;
  font-size: 14px;
  margin: 16px 0 2px;
  text-align: left;
}
.form-msg.error {
  background: rgba(255, 107, 107, .12);
  border: 1px solid rgba(255, 107, 107, .35);
  color: #ffb4b4;
}
.form-msg.success {
  background: rgba(62, 207, 142, .1);
  border: 1px solid rgba(62, 207, 142, .3);
  color: #8fe3bd;
}
.form-msg .material-icons { font-size: 19px; flex-shrink: 0; }

/* ---------- Auth (login / setup) ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 430px;
  background: rgba(15, 16, 22, .78);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 42px 36px 34px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
.auth-logo { display: flex; justify-content: center; margin-bottom: 18px; }
.auth-logo .logo {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.auth-logo .logo .material-icons { font-size: 32px; color: #fff; }
.auth-title { text-align: center; font-size: 26px; margin-bottom: 6px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 14.5px; margin-bottom: 10px; }
.auth-card form { margin-top: 8px; }

.pw-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  display: grid;
  place-items: center;
}
.pw-toggle:hover { color: var(--text); }
.pw-toggle .material-icons { font-size: 21px; }

.auth-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 20px;
  text-align: center;
}
.auth-secure .material-icons { font-size: 17px; color: var(--success); }

/* Setup page */
.setup-card .form-msg { margin: 18px 0; }
.setup-card .btn { margin-top: 10px; }
.cred-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, .05);
  border: 1px dashed rgba(106, 123, 255, .45);
  border-radius: 14px;
  padding: 18px;
  margin: 16px 0;
}
.cred-row { display: flex; align-items: center; gap: 12px; }
.cred-row .material-icons { color: var(--accent); }
.cred-label { font-size: 12px; color: var(--muted); }
.cred-value { font: 600 16px 'Inter', sans-serif; word-break: break-all; }
.setup-warn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: #ffd9a0;
  background: rgba(255, 159, 67, .1);
  border: 1px solid rgba(255, 159, 67, .3);
  border-radius: 12px;
  padding: 13px 15px;
  margin: 14px 0;
}
.setup-warn .material-icons { font-size: 19px; flex-shrink: 0; }
.setup-warn.danger { color: #ffb4b4; background: rgba(255, 107, 107, .1); border-color: rgba(255, 107, 107, .35); }
.setup-card code {
  background: rgba(255, 255, 255, .08);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 13px;
}

/* ---------- Flashcards ---------- */
.fc-progress { font-size: 13.5px; margin-bottom: 12px; text-align: center; }
.flashcard {
  max-width: 560px;
  margin: 0 auto;
  height: 280px;
  perspective: 1400px;
  cursor: pointer;
}
.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.4, .2, .2, 1);
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 30px;
  text-align: center;
}
.flashcard-face.front {
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.flashcard-face.back {
  background: linear-gradient(160deg, rgba(106, 123, 255, .16), rgba(138, 91, 255, .16));
  border: 1px solid rgba(106, 123, 255, .35);
  transform: rotateY(180deg);
}
.fc-word { font: 700 clamp(24px, 4.5vw, 34px) 'Poppins', sans-serif; word-break: break-word; }
.fc-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.fc-hint .material-icons { font-size: 17px; }

.fc-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: #c3c9ff;
  background: rgba(106, 123, 255, .16);
  border: 1px solid rgba(106, 123, 255, .3);
  border-radius: 999px;
  padding: 4px 12px;
}
.tag-soft { color: var(--muted); background: rgba(255, 255, 255, .06); border-color: var(--border); }

/* ---------- Quiz ---------- */
.quiz-panel { max-width: 680px; margin: 0 auto; }
.quiz-question {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 10px 0 22px;
  text-align: center;
}
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.option {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 16px 18px;
  border-radius: 12px;
  cursor: pointer;
  font: 500 15px 'Inter', sans-serif;
  text-align: left;
  min-height: 58px;
}
.option:hover { background: var(--bg-card-hover); }
.option:disabled { cursor: default; }
.option.correct {
  background: rgba(62, 207, 142, .16);
  border-color: rgba(62, 207, 142, .55);
}
.option.wrong {
  background: rgba(255, 107, 107, .14);
  border-color: rgba(255, 107, 107, .5);
}
.quiz-feedback {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 14.5px;
  font-weight: 600;
  text-align: left;
}
.quiz-feedback.good { color: var(--success); }
.quiz-feedback.bad { color: var(--danger); }
.quiz-feedback .material-icons { font-size: 20px; }

.qr-score { font: 700 44px 'Poppins', sans-serif; margin: 6px 0; }

/* ---------- Phrasebook ---------- */
.phrase-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.phrase-row:last-child { border-bottom: 0; }
.phrase-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.phrase-front { font-weight: 600; font-size: 15.5px; }
.phrase-back { color: var(--muted); font-size: 14px; }
.phrase-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Empty states ---------- */
.empty-state {
  text-align: center;
  padding: 46px 20px;
  color: var(--muted);
}
.empty-state .material-icons { font-size: 46px; margin-bottom: 12px; color: var(--accent); }
.empty-state h2 { color: var(--text); margin-bottom: 8px; }
.empty-state .btn { margin-top: 18px; }
.done-ic { color: var(--success) !important; }

/* ---------- Footer / toast ---------- */
.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 26px 20px 34px;
  border-top: 1px solid var(--border);
}

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 22, 30, .96);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  z-index: 100;
  max-width: 90vw;
  text-align: center;
}
.toast.show { opacity: 1; }

/* ============================================================
   Responsive — all devices
   ============================================================ */
@media (max-width: 980px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 880px) {
  .hamburger { display: grid; }
  .logout-label { display: none; }
  .user-chip span:not(.material-icons) { display: none; }
  .user-chip { max-width: none; }

  .nav {
    position: fixed;
    top: 69px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(14, 15, 21, .97);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px 14px;
    gap: 4px;
    display: none;
    z-index: 60;
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px; font-size: 16px; border-radius: 10px; }
}

@media (max-width: 640px) {
  .container { padding: 22px 16px 48px; }
  .header-inner { padding: 11px 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 16px; gap: 10px; }
  .stat-value { font-size: 21px; }
  .stat-ic { width: 46px; height: 46px; font-size: 25px !important; }
  .form-grid { grid-template-columns: 1fr; }
  .flashcard { height: 240px; }
  .auth-card { padding: 34px 24px 28px; }
  .phrase-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .phrase-meta { justify-content: flex-start; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
  .controls-row label { min-width: 100%; }
  .controls-row .btn { width: 100%; }
  .fc-actions .btn { flex: 1; }
}