@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --font: 'Outfit', sans-serif;
  --bg: #FDFDFF;
  --accent: #6366F1;
  --accent-grad: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #EC4899 100%);
  --text-main: #0F172A;
  --text-muted: #64748B;
  --shadow-xl: 0 30px 80px -15px rgba(0, 0, 0, 0.12);
  --emerald: #10B981;
  --rose: #F43F5E;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text-main); -webkit-font-smoothing: antialiased; line-height: 1.4; overflow-x: hidden; }

/* Utility Classes */
.hidden { display: none !important; }
.animate-in { animation: fadeIn 0.8s ease-out forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* LOADING BAR (Premium) */
.loading-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--accent-grad);
  background-size: 200% 100%;
  border-radius: 2rem 2rem 0 0;
  animation: moveGradient 1.5s linear infinite;
  display: none;
  z-index: 10;
}
@keyframes moveGradient {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* IG FETCH STATUS BADGE */
.ig-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 0.75rem;
  opacity: 0;
  transform: translateY(5px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.ig-status.visible { opacity: 1; transform: translateY(0); }
.ig-status-loading { background: rgba(99, 102, 241, 0.08); color: var(--accent); }
.ig-status-success { background: rgba(16, 185, 129, 0.08); color: var(--emerald); }
.ig-status-error   { background: rgba(244, 63, 94, 0.08); color: var(--rose); }

/* SPINNER Small */
.spinner-s {
  width: 14px; height: 14px;
  border: 2px solid rgba(0,0,0,0.05);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
.btn-fetch .spinner-s {
  border-color: rgba(255,255,255,0.2);
  border-top-color: #fff;
}

/* SPINNER Normal */
.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Backgrounds */
.bg-blob { position: fixed; width: 60vw; height: 60vw; border-radius: 50%; filter: blur(120px); opacity: 0.12; z-index: -1; pointer-events: none; }
.blob-1 { top: -10vw; right: -10vw; background: #6366F1; }
.blob-2 { bottom: -10vw; left: -10vw; background: #EC4899; }

/* Navigation - Responsive */
nav { 
  position: sticky; top: 0; z-index: 1000; padding: 1rem 1.5rem; 
  background: rgba(11, 15, 26, 0.98); 
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); 
  border-bottom: 1px solid rgba(255, 255, 255, 0.05); 
}
.nav-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.nav-logo { display:flex; align-items:center; gap:0.5rem; text-decoration:none; color: white; }
.nav-logo-text { display: flex; align-items: center; gap: 0.4rem; text-transform: none; color: white; }

@media (max-width: 640px) {
    .nav-logo-text span { display: none; } 
    .nav-logo-text b { display: none; }
    .nav-badge { display: none; }
}

.nav-badge { font-size: 0.6rem; font-weight: 800; padding: 0.3rem 0.7rem; border-radius: 99px; background: rgba(255,255,255,0.05); color: #94A3B8; text-transform: uppercase; letter-spacing: 0.12em; display: flex; align-items: center; gap: 0.4rem; border: 1px solid rgba(255,255,255,0.05); }
.nav-badge::before { content:''; width:6px; height:6px; border-radius:50%; background:var(--emerald); }

.main-container { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 0; }

/* Hero - Compact */
.hero { margin-bottom: 2rem; text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.7rem; background: rgba(99, 102, 241, 0.06); color: var(--accent); border-radius: 0.6rem; font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.75rem; }
.hero-title { font-size: clamp(1.8rem, 8vw, 2.3rem); font-weight: 900; line-height: 1.05; letter-spacing: -0.04em; margin-bottom: 0.75rem; color: #0F172A; max-width: 800px; }
.hero-title span { background: var(--accent-grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { font-size: 0.9rem; color: var(--text-muted); max-width: 750px; line-height: 1.5; font-weight: 500; opacity: 0.9; }

/* Cockpit - Tighter Padding */
.cockpit { 
    background: white; border-radius: 2rem; 
    padding: 1.75rem 2rem; 
    box-shadow: var(--shadow-xl); border: 1px solid white; 
    margin-bottom: 1.5rem; position: relative; 
    overflow: hidden; 
}
.cockpit-header { display: flex; flex-direction: column; text-align: center; gap: 0.5rem; margin-bottom: 2rem; }
.cockpit-title { 
  font-size: clamp(0.65rem, 2.5vw, 0.75rem); font-weight: 900; text-transform: uppercase; letter-spacing: 0.25em; 
  background: var(--accent-grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem 1.25rem; align-items: start; }
.btn-main { grid-column: span 3; margin-top: 0.5rem; }

@media (max-width: 1024px) {
    .form-grid { grid-template-columns: repeat(2, 1fr); }
    .btn-main { grid-column: span 2; }
}

@media (max-width: 640px) {
    .cockpit { padding: 1.25rem 1rem; border-radius: 1.5rem; }
    .cockpit-header { margin-bottom: 1.5rem; }
    .form-grid { grid-template-columns: 1fr; gap: 1rem; }
    .btn-main { grid-column: span 1; margin-top: 0.25rem; }
}

.field label { font-size: 0.65rem; font-weight: 800; color: var(--text-main); text-transform: uppercase; letter-spacing: 0.05em; display:flex; align-items:center; gap:0.6rem; margin-bottom: 0.4rem; }

/* WOW INPUT STYLES */
.wow-group {
    background: white !important;
    border: 2px solid transparent !important;
    background-image: linear-gradient(white, white), var(--accent-grad) !important;
    background-origin: border-box !important;
    background-clip: padding-box, border-box !important;
}

.input-group { position: relative; background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 1rem; transition: all 0.4s; overflow: hidden; }
.input-group:focus-within { background: white; border-color: var(--accent); box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.08); transform: translateY(-1px); }
.input-group input { width: 100%; border: none; background: transparent; padding: 0.65rem 0.9rem; font-size: 0.9rem; font-weight: 700; color: var(--text-main); outline: none; }
.input-group input::placeholder { color: #CBD5E1; font-weight: 500; }
.input-group input:-webkit-autofill,
.input-group input:-webkit-autofill:hover,
.input-group input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px white inset;
  -webkit-text-fill-color: var(--text-main);
  transition: background-color 5000s ease-in-out 0s;
}
.input-group.prefix input { padding-left: 2.5rem; }
.input-symbol { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); font-weight: 900; color: var(--accent); font-size: 0.9rem; }

/* BTN FETCH Fixed width */
.btn-fetch { 
    position: absolute; right: 0.3rem; top: 0.3rem; bottom: 0.3rem; 
    min-width: 75px; 
    padding: 0 0.75rem; background: black; color: white; border: none; 
    border-radius: 0.7rem; font-size: 0.6rem; font-weight: 800; 
    cursor: pointer; transition: 0.2s; 
    display: flex; align-items: center; justify-content: center;
}

.btn-main { background: var(--accent-grad); color: white; border: none; padding: 1.15rem; border-radius: 1.25rem; font-size: 1rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em; cursor: pointer; transition: all 0.4s; box-shadow: 0 15px 30px -10px rgba(99, 102, 241, 0.4); display: flex; align-items: center; justify-content: center; gap: 1rem; }

/* Bento Results */
#results-area { margin-top: 2rem; }

/* VYRAZNY VERDICT BOX (BALANCED) */
.verdict {
    scroll-margin-top: 8rem;
    background: white; border-radius: 2rem; 
    padding: 2.25rem; display: flex; gap: 2rem; 
    align-items: center; margin-bottom: 2rem; 
    border: 2px solid #F1F5F9; 
    box-shadow: 0 20px 50px -10px rgba(0,0,0,0.05);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 900px) {
    .verdict { padding: 2.5rem 3.5rem; gap: 3.5rem; border-radius: 2.5rem; }
}

@media (max-width: 640px) {
    .verdict { flex-direction: column; text-align: center; gap: 1.5rem; padding: 2rem 1.25rem; border-radius: 1.75rem; }
}

.v-icon { 
    width: 70px; height: 70px; border-radius: 1.75rem; 
    display:flex; align-items:center; justify-content:center; 
    font-size: 1.8rem; font-weight: 900; flex-shrink: 0; 
    box-shadow: 0 10px 20px -5px rgba(0,0,0,0.1);
}
@media (min-width: 900px) {
    .v-icon { width: 100px; height: 100px; border-radius: 2.5rem; font-size: 3rem; }
}

.v-body h4 { font-size: 0.65rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.2em; margin-bottom: 0.5rem; opacity:0.6; }
.v-body h3 { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.03em; line-height: 1.05; margin-bottom: 0.5rem; }
@media (min-width: 900px) {
    .v-body h3 { font-size: 2.5rem; }
}
.v-body p { font-size: 0.95rem; font-weight: 500; opacity: 0.8; }

/* GOOD VERDICT */
.good {
    background: linear-gradient(135deg, #DCFCE7 0%, #BBF7D0 100%);
    border-color: #16A34A;
    border-width: 3px;
    color: #14532D;
    box-shadow: 0 25px 70px -15px rgba(22, 163, 74, 0.4), inset 0 1px 0 rgba(255,255,255,0.7);
}
.good .v-icon {
    background: linear-gradient(135deg, #22C55E 0%, #16A34A 100%);
    color: white;
    box-shadow: 0 15px 35px -5px rgba(34, 197, 94, 0.55);
}

/* BAD VERDICT */
.bad {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    border-color: #DC2626;
    border-width: 3px;
    color: #7F1D1D;
    box-shadow: 0 25px 70px -15px rgba(220, 38, 38, 0.35), inset 0 1px 0 rgba(255,255,255,0.7);
}
.bad .v-icon {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
    box-shadow: 0 15px 35px -5px rgba(239, 68, 68, 0.55);
}

.verdict.idle {
    border: 7px solid transparent;
    background-image: linear-gradient(white, white), var(--accent-grad);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 20px 60px -15px rgba(99, 102, 241, 0.25);
}
.verdict.loading {
    border: 7px solid transparent;
    background-image: linear-gradient(#F8FAFC, #F8FAFC), var(--accent-grad);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    opacity: 0.7;
}

/* COMPACT BENTO TILES */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0.75rem; }
.tile { 
    background: white; border-radius: 1.25rem; 
    padding: 1rem; border: 1px solid #F1F5F9; 
    display: flex; flex-direction: column; 
    justify-content: space-between; position: relative; 
}

.tile-main { grid-column: span 12; background: white; color: var(--text-main); border: 1px solid #F1F5F9; padding: 1.25rem 1.5rem; }
.tile-side { grid-column: span 12; }
.tile-mini { grid-column: span 6; }
.tile-wide { grid-column: span 12; }

@media (min-width: 900px) {
    .tile-main { grid-column: span 6; }
    .tile-side { grid-column: span 6; }
    .tile-mini { grid-column: span 3; }
}

.t-lbl { font-size: 0.58rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.5; margin-bottom: 0.75rem; }
.t-val { font-size: 1.4rem; font-weight: 900; letter-spacing: -0.03em; }
.tile-main .t-val { font-size: 1.4rem; }
.t-sub { font-size: 0.7rem; font-weight: 500; opacity: 0.6; margin-top: 0.25rem; }

.vs-row { display: flex; align-items: baseline; gap: 0.6rem; margin-top: 0.15rem; }
.vs-mark { font-size: 0.55rem; font-weight: 900; text-transform: uppercase; opacity: 0.3; }

/* Details / FAQ */
details.modern { background: white; border: 1px solid #F1F5F9; border-radius: 1.5rem; overflow: hidden; margin-bottom: 1rem; transition: 0.4s; }
details.modern > summary { padding: 1.15rem 1.5rem; cursor: pointer; font-weight: 800; font-size: 0.95rem; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.modern > summary::after { content: '+'; font-size: 1.25rem; opacity: 1; width: 40px; height: 40px; background: #F8FAFC; border-radius: 10px; display: flex; align-items: center; justify-content: center; transition: 0.4s; font-weight: 400; color: #334155; }
details.modern[open] > summary::after { content: '×'; background: black; color: white; }
#disclaimer-area > summary { font-size: 1.45rem; }
#disclaimer-area > summary .disclaimer-summary-text { background: linear-gradient(135deg, #6d28d9, #9333ea, #c084fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
#disclaimer-area ol { list-style: none; counter-reset: disclaimer-counter; padding-left: 0; }
#disclaimer-area ol li { counter-increment: disclaimer-counter; padding-left: 2.25rem; position: relative; margin-bottom: 1.1rem; }
#disclaimer-area ol li::before { content: counter(disclaimer-counter) "."; position: absolute; left: 0; top: 0; font-weight: 800; font-size: 1rem; background: linear-gradient(135deg, #6d28d9, #a855f7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.details-content { padding: 1.75rem; font-size: 0.9rem; line-height: 1.6; }

/* Footer - Responsive */
footer { background: #0B0F1A; color: white; padding: 4rem 1.5rem 3rem; margin-top: 4rem; }
.f-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1fr; gap: 3rem; }
@media (min-width: 900px) {
    .f-inner { grid-template-columns: 1fr 1.5fr 1.5fr; gap: 4rem; }
}
.f-col h4 { font-size: 0.7rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.2rem; color: #475569; margin-bottom: 1.5rem; }
.f-links { list-style: none; }
.f-links li { margin-bottom: 1rem; }
.f-links a { text-decoration: none; color: #94A3B8; font-weight: 600; font-size: 0.95rem; transition: 0.2s; }
.f-links a:hover { color: white; }
.f-copy { flex-direction: column; gap: 1.5rem; text-align: center; margin-top: 3rem; padding: 2rem 0; border-top: 1px dotted rgba(255,255,255,0.05); }
@media (min-width: 640px) {
    .f-copy { flex-direction: row; text-align: left; }
}

/* DISCLAIMER NUMBERING */
.disclaimer-list { list-style: none; display: flex; flex-direction: column; gap: 1rem; counter-reset: disclaimer-counter; }
.disclaimer-list li { position: relative; padding-left: 2.5rem; counter-increment: disclaimer-counter; }
.disclaimer-list li::before { 
    content: counter(disclaimer-counter) "."; 
    position: absolute; left: 0; font-weight: 900; font-size: 0.95rem;
    background: var(--accent-grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    width: 2rem; text-align: left;
}

.kni-intro-card {
  background: white; border-radius: 1.5rem; padding: 2rem;
  margin: 2rem 0; font-size: 0.95rem; color: var(--text-muted);
  line-height: 1.6; border: 1px solid #F1F5F9;
  box-shadow: var(--shadow-xl); position: relative;
  font-style: italic; text-align: center;
}

/* LEGEND DETAILS (below form-grid) */
.legend-details {
  grid-column: 1 / -1;
  align-self: center;
  border: none;
  background: transparent;
  margin-top: 0.25rem;
}
.legend-details > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  list-style: none;
  font-size: 0.68rem;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.85rem;
  border-radius: 99px;
  border: none;
  background: var(--accent-grad);
  transition: opacity 0.2s;
  user-select: none;
  width: fit-content;
}
.legend-details > summary::-webkit-details-marker { display: none; }
.legend-details > summary::before { content: '?'; font-size: 0.65rem; font-weight: 900; color: white; }
.legend-details > summary:hover { opacity: 0.85; }

.legend-list {
  display: flex; flex-direction: column;
  margin-top: 0.85rem;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 0.85rem;
  overflow: hidden;
}
.legend-row {
  display: grid; grid-template-columns: 10.5rem 1fr;
  gap: 0.75rem; align-items: baseline;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid #E2E8F0;
}
.legend-row:last-child { border-bottom: none; }
.legend-row dt { font-size: 0.7rem; font-weight: 800; color: var(--text-main); }
.legend-en { font-weight: 500; color: var(--text-muted); }
.legend-row dd { font-size: 0.75rem; font-weight: 500; color: var(--text-muted); line-height: 1.4; }
.legend-row dd em { font-style: normal; font-weight: 700; color: var(--text-main); }
.legend-formula { background: rgba(99,102,241,0.03); }
.legend-formula dt { color: var(--accent); }
.legend-formula dd { font-weight: 700; color: var(--text-main); font-family: monospace; font-size: 0.75rem; }

.label-hint {
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.8;
}

@media (max-width: 1024px) {
  .legend-details { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .legend-details { grid-column: span 1; }
  .legend-row { grid-template-columns: 1fr; gap: 0.1rem; padding: 0.5rem 0.85rem; }
}

/* LOGIN GATE */
body.gate-card-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}
.gate-card-login {
  background: white;
  border-radius: 2rem;
  padding: 3rem 2.5rem;
  box-shadow: var(--shadow-xl);
  border: 1px solid #F1F5F9;
  text-align: center;
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 1;
}
.gate-card-login h2 {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}
.gate-card-login p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.gate-card-login input[type="password"] {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1.5px solid #E2E8F0;
  border-radius: 0.75rem;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  outline: none;
  transition: border-color 0.15s;
}
.gate-card-login input[type="password"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.gate-card-login button[type="submit"] {
  width: 100%;
  padding: 0.85rem;
  background: var(--accent-grad);
  color: white;
  border: none;
  border-radius: 0.75rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.gate-card-login button[type="submit"]:hover { opacity: 0.9; }
.gate-card-login .error {
  color: var(--rose);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}
