/* Krampus App UI (glass / soft minimalism) */
/* Designed to match your login/register style.css vibe */

/* --- FIX: override login/register global body styles --- */
body.app-body{
  display: block !important;
  align-items: initial !important;
  justify-content: initial !important;
  padding: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  min-height: 100vh !important;
}

:root{
  --bg1:#fbfaff;
  --bg2:#f6f2ff;
  --bg3:#f1ecff;

  --ink:#17162b;
  --muted:#5b5a73;

  --card: rgba(255,255,255,0.55);
  --card-2: rgba(255,255,255,0.40);
  --stroke: rgba(68, 58, 104, 0.12);

  --shadow: 0 18px 60px rgba(35, 22, 70, 0.12);
  --shadow2: 0 10px 28px rgba(35, 22, 70, 0.10);

  --accent:#19d3ff;
  --accent2:#7b5cff;

  --radius-xl: 26px;
  --radius-lg: 20px;

  --blur: 22px;
}

*{ box-sizing:border-box; }
html, body { height:100%; }

body.app-body{
  margin:0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, var(--bg1) 0%, var(--bg2) 50%, var(--bg3) 100%);
  overflow-x:hidden;
}

/* Background blobs (same mood as your login) */
.soft-background{
  position:fixed; inset:0;
  z-index:0; pointer-events:none;
}
.floating-shapes{ position:absolute; width:100%; height:100%; }
.soft-blob{
  position:absolute;
  border-radius: 50% 40% 60% 30%;
  background: linear-gradient(45deg, rgba(216, 201, 245, 0.40), rgba(196, 181, 240, 0.30));
  filter: blur(90px);
  animation: softFloat 12s ease-in-out infinite;
}
.blob-1{ width:360px; height:300px; top:-12%; left:-6%; }
.blob-2{ width:260px; height:220px; top:62%; right:-6%; animation-delay:-4s; }
.blob-3{ width:220px; height:200px; top:18%; right:18%; animation-delay:-8s; }
.blob-4{ width:160px; height:140px; bottom:10%; left:14%; animation-delay:-6s; }

@keyframes softFloat{
  0%,100%{ transform: translate(0,0) rotate(0deg) scale(1); border-radius: 50% 40% 60% 30%; }
  25%{ transform: translate(30px,-20px) rotate(90deg) scale(1.08); border-radius: 35% 55% 45% 65%; }
  50%{ transform: translate(-10px,25px) rotate(180deg) scale(1.02); border-radius: 60% 30% 50% 40%; }
  75%{ transform: translate(20px,10px) rotate(270deg) scale(1.10); border-radius: 40% 60% 35% 55%; }
}

/* Layout */
.app-shell{
  position:relative;
  z-index:1;
  min-height:100%;
  display:flex;
  flex-direction:column;
}

.container{
  width:min(1100px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar{
  position:sticky;
  top:16px;
  z-index:10;
  margin: 16px auto 0;
}

.nav-glass{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;

  padding: 14px 16px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255,255,255,0.70), rgba(255,255,255,0.38));
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow2);
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  color:inherit;
}

.brand-mark{
  width:42px;
  height:42px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.60);
  box-shadow: 0 10px 24px rgba(35, 22, 70, 0.10);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.brand-mark img{
  width:30px;
  height:30px;
  object-fit:contain;
}

.brand-name{
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 18px;
}

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

.nav-profile{
  display:inline-flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color: inherit;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.42);
  transition: background .18s ease, box-shadow .18s ease;
}
.nav-profile:hover{
  background: rgba(255,255,255,0.65);
  box-shadow: 0 8px 26px rgba(35, 22, 70, 0.10);
}
.nav-profile__img{
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.9);
  flex-shrink: 0;
}
.nav-profile__label{
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 8px 4px;
}
.nav-profile:hover .nav-profile__label{
  background: transparent !important;
  box-shadow: none !important;
}

.dashboard-profile{
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.dashboard-profile__avatar{
  width: 88px;
  height: 88px;
  border-radius: 22px;
  object-fit: cover;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow2);
  flex-shrink: 0;
}
.dashboard-profile__body{
  min-width: 0;
}
.dashboard-profile__hello{
  margin: 0;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}
.dashboard-profile-form{
  border-top: 1px solid var(--stroke);
  padding-top: 18px;
  margin-top: 18px;
  max-width: 420px;
}

main.app-main{
  padding: 22px 0 40px;
}

/* Cards */
.glass-card{
  border-radius: var(--radius-xl);
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255,255,255,0.68), rgba(255,255,255,0.34));
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
}

.card-pad{
  padding: 26px;
}

.card-title{
  margin:0;
  font-size: 26px;
  letter-spacing:-0.03em;
}
.card-subtitle{
  margin:10px 0 0;
  color: var(--muted);
  line-height:1.55;
}

/* Buttons */
.btn{
  appearance:none;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.55);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 14px;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  font-weight:600;
  transition: transform .08s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover{
  background: rgba(255,255,255,0.72);
  box-shadow: 0 14px 34px rgba(35, 22, 70, 0.10);
}
.btn:active{ transform: translateY(1px); }

.btn-primary{
  border-color: rgba(25, 211, 255, 0.35);
  background: linear-gradient(135deg, rgba(25,211,255,0.32), rgba(123,92,255,0.20));
}
.btn-primary:hover{
  background: linear-gradient(135deg, rgba(25,211,255,0.40), rgba(123,92,255,0.26));
}

.btn-ghost{
  background: rgba(255,255,255,0.32);
}

/* Inputs */
.field{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.label{
  font-size: 13px;
  color: var(--muted);
}
.input, .textarea{
  width:100%;
  border-radius: 16px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.56);
  padding: 12px 14px;
  font-size: 15px;
  outline:none;
  transition: box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.textarea{ resize: vertical; min-height: 120px; }
.input:focus, .textarea:focus{
  border-color: rgba(25, 211, 255, 0.45);
  box-shadow: 0 0 0 6px rgba(25, 211, 255, 0.12);
  background: rgba(255,255,255,0.72);
}

.helper{
  font-size: 13px;
  color: var(--muted);
}

/* Lists / rows */
.list{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-top:16px;
}
.row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding: 14px 16px;
  border-radius: 18px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.40);
}
.row:hover{ background: rgba(255,255,255,0.55); }

.row-title{ font-weight:700; letter-spacing:-0.02em; }
.row-meta{ color: var(--muted); font-size: 13px; margin-top:3px; }

.row.row-dashboard{ align-items: center; }
.row-link-block{
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  padding: 0;
}
.row-action-group{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.row-delete-form{ margin: 0; }

.btn-danger-ghost{
  border-color: rgba(255, 0, 84, 0.24);
  color: #9e0a2f;
  background: rgba(255, 0, 84, 0.08);
}
.btn-danger-ghost:hover{
  background: rgba(255, 0, 84, 0.14);
  box-shadow: 0 10px 26px rgba(180, 0, 50, 0.12);
}

/* 404 */
.not-found-outer{
  width: 100%;
  min-height: min(72vh, 820px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.visually-hidden{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.not-found-page{
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
.not-found-figure{
  margin: 0 0 18px;
  display: flex;
  justify-content: center;
}
.not-found-figure img{
  max-width: 100%;
  width: min(100%, 520px);
  height: auto;
  display: block;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow2);
}
.not-found-caption{
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}
.not-found-action{ margin: 0; }

.badge{
  font-size: 12px;
  font-weight:700;
  padding: 6px 10px;
  border-radius: 999px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.52);
}
.badge-accent{
  border-color: rgba(25,211,255,0.38);
  background: rgba(25,211,255,0.16);
}
.badge-soft{
  background: rgba(123,92,255,0.10);
  border-color: rgba(123,92,255,0.18);
}

/* Quiz */
.quiz-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}
.quiz-kpis{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.q-card{ margin-top:14px; }
.q-title{ margin:0 0 10px; font-size: 18px; letter-spacing:-0.02em; }

.choice{
  display:flex;
  align-items:center;
  gap:12px;
  padding: 12px 12px;
  border-radius: 16px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.44);
  cursor:pointer;
  transition: background .18s ease, transform .08s ease;
}
.choice:hover{ background: rgba(255,255,255,0.62); }
.choice:active{ transform: translateY(1px); }

.choice input{
  width:18px;
  height:18px;
}

/* Alerts (flash) */
.flash-stack{ display:flex; flex-direction:column; gap:10px; margin: 14px 0 0; }
.flash{
  padding: 12px 14px;
  border-radius: 18px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.55);
}
.flash.error{
  border-color: rgba(255,0,84,0.20);
  background: rgba(255,0,84,0.08);
}
.flash.ok{
  border-color: rgba(25,211,255,0.30);
  background: rgba(25,211,255,0.10);
}

/* Create test — generation wait */
.create-test-form{
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.create-test-submit{
  height: 46px;
  margin-top: 2px;
}

.generate-overlay[hidden]{
  display: none !important;
}
.generate-overlay{
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(23, 22, 43, 0.42);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: generateOverlayIn 0.35s ease-out both;
}
@keyframes generateOverlayIn{
  from { opacity: 0; }
  to { opacity: 1; }
}

.generate-modal{
  width: min(360px, 100%);
  padding: 22px 20px 20px;
  text-align: center;
  box-shadow: var(--shadow), 0 0 0 1px rgba(25, 211, 255, 0.12);
  animation: generateModalIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes generateModalIn{
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.generate-wait-title{
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: var(--ink);
  animation: generateTitlePulse 2.2s ease-in-out infinite;
}
@keyframes generateTitlePulse{
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

.generate-video-wrap{
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.generate-wait-video{
  display: block;
  width: 100%;
  height: auto;
  max-height: min(52vh, 320px);
  object-fit: cover;
  vertical-align: middle;
}

/* Utility */
.mt16{ margin-top:16px; }
.mt22{ margin-top:22px; }
.mt28{ margin-top:28px; }
.w100{ width:100%; }

/* Modal: captcha поверх страницы лендинга теста */
.kc-modal-overlay{
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.kc-modal-overlay.kc-modal-overlay--open{
  display: flex;
}
.kc-modal-overlay__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(23, 22, 43, 0.48);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.kc-modal-overlay__panel{
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: min(92vh, 720px);
  overflow: auto;
}
.kc-modal-overlay__close{
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  line-height: 1;
  border-radius: 12px;
}
body.kc-modal-open{
  overflow: hidden;
}
.kc-captcha-error{
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 0, 84, 0.22);
  background: rgba(255, 0, 84, 0.08);
  color: #8a0628;
  font-size: 14px;
  margin-bottom: 12px;
}
.kc-modal-overlay .krampus-captcha{
  max-width: none;
}
