/* FrameCheck AI — Mobile-first UI (RTL/LTR safe) */
:root{
  --bg:#0b0f17;
  --card:#0f1724;
  --card2:#111b2b;
  --text:#e9eef7;
  --muted:#a9b4c6;
  --line:rgba(255,255,255,.10);
  --brand:#ffcc66;
  --brand2:#9ad7ff;
  --good:#2fe27a;
  --warn:#ffcc66;
  --bad:#ff5c7a;
  --shadow: 0 18px 50px rgba(0,0,0,.35);
  --radius: 18px;
  --max: 1100px;
  --pad: clamp(16px, 2.8vw, 28px);
}

*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family: "Cairo", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(154,215,255,.16), transparent 60%),
              radial-gradient(900px 500px at 85% 20%, rgba(255,204,102,.14), transparent 55%),
              var(--bg);
  color:var(--text);
  overflow-x:hidden; /* prevent horizontal scroll */
}

a{ color:inherit; text-decoration:none; }
button, input, select, textarea{ font:inherit; }

.container{
  width:100%;
  max-width:var(--max);
  margin:0 auto;
  padding:0 var(--pad);
}

.topbar{
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter: blur(12px);
  background: linear-gradient(to bottom, rgba(11,15,23,.92), rgba(11,15,23,.55));
  border-bottom:1px solid var(--line);
}

.topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 0;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.brand img{
  width:38px; height:38px;
  border-radius:12px;
  box-shadow: 0 10px 25px rgba(0,0,0,.35);
}
.brand .name{
  display:flex; flex-direction:column; line-height:1.1;
}
.brand .name strong{ font-size:1.02rem; }
.brand .name span{ color:var(--muted); font-size:.84rem; }

.nav{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.nav a{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid transparent;
  color:var(--muted);
}
.nav a:hover{ border-color:var(--line); color:var(--text); background:rgba(255,255,255,.03); }
.nav .pill{
  border-color: rgba(255,204,102,.25);
  color:var(--text);
  background: rgba(255,204,102,.06);
}
.lang{
  display:flex; gap:8px; align-items:center;
}
.lang a{
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:12px;
  color:var(--muted);
}
.lang a.active{ color:var(--text); border-color: rgba(154,215,255,.35); background: rgba(154,215,255,.08); }

.hero{
  padding: 34px 0 18px;
}
.hero-grid{
  display:grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
  align-items:stretch;
}
@media (max-width: 980px){
  .hero-grid{ grid-template-columns: 1fr; }
}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.02));
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.card-pad{ padding: 20px; }
@media (max-width: 520px){ .card-pad{ padding: 16px; } }

.kicker{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding:8px 10px;
  border:1px solid rgba(255,204,102,.22);
  background: rgba(255,204,102,.07);
  border-radius: 999px;
  font-size: .9rem;
  color: var(--text);
}
.kicker svg{ width:16px; height:16px; opacity:.9; }

.h1{
  margin: 14px 0 8px;
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  letter-spacing: .2px;
}
.sub{
  margin:0;
  color: var(--muted);
  font-size: clamp(.95rem, 1.8vw, 1.05rem);
  line-height: 1.8;
}

.actions{
  margin-top: 16px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.btn{
  appearance:none;
  border:none;
  border-radius: 14px;
  padding: 12px 14px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:10px;
  font-weight:700;
  letter-spacing:.2px;
  user-select:none;
  transition: transform .08s ease, opacity .12s ease, background .12s ease, border-color .12s ease;
}
.btn:active{ transform: translateY(1px); }
.btn-primary{
  background: linear-gradient(90deg, rgba(255,204,102, .95), rgba(154,215,255,.95));
  color: #0b0f17;
}
.btn-ghost{
  background: rgba(255,255,255,.03);
  border:1px solid var(--line);
  color: var(--text);
}
.btn-ghost:hover{ background: rgba(255,255,255,.05); }
.btn small{ font-weight:600; opacity:.9; }

.form{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.tabs{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:6px;
}
.tab{
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255,255,255,.02);
  cursor:pointer;
}
.tab.active{
  border-color: rgba(154,215,255,.35);
  background: rgba(154,215,255,.08);
  color: var(--text);
}
.field{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.label{
  color: var(--muted);
  font-size:.92rem;
}
.input, .select{
  width:100%;
  border:1px solid var(--line);
  background: rgba(0,0,0,.18);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 12px;
  outline:none;
}
.input:focus, .select:focus{
  border-color: rgba(255,204,102,.35);
  box-shadow: 0 0 0 4px rgba(255,204,102,.08);
}
.hint{ color: var(--muted); font-size:.9rem; }

.row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.row > *{ flex:1 1 180px; }

.check{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.02);
}
.check input{ margin-top:4px; }

.flash{
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text);
}

.footer{
  padding: 26px 0 34px;
  color: var(--muted);
  font-size:.92rem;
}
.footer a{ text-decoration:underline; }

.result-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 980px){ .result-grid{ grid-template-columns: 1fr; } }

.gauge{
  display:flex; align-items:center; justify-content:space-between;
  gap: 14px;
}
.score-big{
  font-size: clamp(2.2rem, 4.6vw, 3.2rem);
  font-weight:800;
}
.badge{
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  font-weight:800;
}
.badge.low{ border-color: rgba(47,226,122,.35); background: rgba(47,226,122,.08); }
.badge.medium{ border-color: rgba(255,204,102,.35); background: rgba(255,204,102,.08); }
.badge.high{ border-color: rgba(255,92,122,.35); background: rgba(255,92,122,.10); }

.list{
  margin:0; padding:0; list-style:none;
  display:flex; flex-direction:column; gap:10px;
}
.list li{
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.02);
}

.table{
  width:100%;
  border-collapse: collapse;
  overflow:hidden;
  border-radius: 16px;
  border:1px solid var(--line);
}
.table th, .table td{
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
  text-align:start;
}
.table th{
  color: var(--muted);
  font-weight:700;
  background: rgba(255,255,255,.02);
}
.table tr:last-child td{ border-bottom:none; }

.dir-rtl{ direction: rtl; }
.dir-ltr{ direction: ltr; font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
