:root{
  --bg: #f7f8fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e5e7eb;
  --brand: #6c5ce7;
  --brand-700:#5a4adf;
  --red: #ef4444;
  --green: #10b981;
  --orange: #f59e0b;
  --shadow: 0 10px 30px rgba(2,6,23,.06);
  --radius: 18px;
  --container: 1040px;
}

/* Dark theme */
:root[data-theme="dark"]{
  --bg: #0b1020;
  --card: #121831;
  --text: #e5e7eb;
  --muted: #9aa3b2;
  --border: #233055;
  --brand: #7c8cff;
  --brand-700:#6476ff;
  --red: #fb7185;
  --green: #34d399;
  --orange: #fbbf24;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background:var(--bg);
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
  direction:ltr; /* default */
}
a{color:inherit}

.container{max-width:var(--container); margin:0 auto; padding:28px 20px 56px}

/* ===== Header ===== */
.header{
  width:100%;
  background:var(--bg);                
  border-bottom:1px solid var(--border);
}
.header-inner{
  width:100%;                         
  max-width:unset;                      
  margin:0;
  padding:8px 40px;                     
  display:flex;
  align-items:center;
  justify-content:space-between;        
  gap:16px;
}
.brand{display:flex; align-items:center; gap:12px; font-weight:700; font-size:20px}
.badge{width:28px; height:28px; display:grid; place-items:center; border-radius:8px; background:#eef2ff1a; color:var(--brand)}
.mode-toggle{width:36px; height:36px; border-radius:10px; border:1px solid var(--border); background:var(--card); display:grid; place-items:center; box-shadow:var(--shadow); cursor:pointer}

/* language + theme together on the right */
.header-actions{display:flex; align-items:center; gap:10px}

/* ===== Hero ===== */
.hero{ text-align:center; padding:34px 0 18px}
.hero .logo-bubble{width:64px; height:64px; margin:0 auto 18px; border-radius:999px; background:#eef2ff22; color:var(--brand); display:grid; place-items:center; box-shadow:inset 0 -6px 10px rgba(92,70,250,.06)}
h1{font-size:40px; line-height:1.15; margin:0 0 10px; letter-spacing:-0.02em}
.sub{color:var(--muted); font-size:16px; max-width:720px; margin:0 auto}

/* ===== Card ===== */
.card{background:var(--card); border:1px solid var(--border); border-radius:18px; box-shadow:var(--shadow); padding:24px; margin:28px auto}
.card.headerlike{max-width:820px}
.card-title{display:flex; align-items:center; justify-content:center; gap:12px}
.card-title .tiny-badge{width:28px; height:28px; border-radius:10px; background:#eef2ff22; display:grid; place-items:center; color:var(--brand)}
.checker-heading{font-size:28px; margin:0; font-weight:800; color:var(--brand)}
.card-sub{ text-align:center; margin:6px 0 0 }
.muted{color:var(--muted)}

/* ===== Input ===== */
.label{font-size:14px; font-weight:600; margin-top:18px; margin-bottom:8px}
.input-row{display:flex; align-items:stretch; gap:10px}
.input-wrap{position:relative; flex:1}
.input-wrap input[type="password"],
.input-wrap input[type="text"]{
  width:100%; height:44px; border-radius:12px; border:1px solid var(--border);
  padding:0 96px 0 14px; font-size:14px; outline:none; background:transparent; color:var(--text);
}
.affix{
  position:absolute; top:4px; right:4px; bottom:4px;
  display:flex; align-items:center; gap:6px; 
}

/* eye / copy buttons inside input */
.input-wrap .affix button.icon-btn {
  background: var(--card);
  border-radius: 10px;
  border: none;              /* no border */
  outline: none;             /* remove focus outline */
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.25s ease-in-out;
  pointer-events: auto;
}
.input-wrap .affix button.icon-btn:hover {
  background: var(--brand);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.input-wrap .affix button.icon-btn:active {
  transform: translateY(0) scale(0.95);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.input-wrap .affix button.icon-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--brand);
}

/* ===== Language button (header) ===== */
.icon-btn[data-action="lang"] {
  background: linear-gradient(135deg, #6c5ce7, #5a4adf);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease-in-out;
  box-shadow: 0 6px 18px rgba(92,70,250,0.25);
}
.icon-btn[data-action="lang"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(92,70,250,0.35);
  background: linear-gradient(135deg, #7c5cff, #6476ff);
}
.icon-btn[data-action="lang"]:active {
  transform: translateY(0) scale(0.95);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.icon-btn[data-action="lang"]:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ===== Tips nav buttons ===== */
.tips-navigation {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
.tips-navigation button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--brand);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.25s ease-in-out;
  box-shadow: var(--shadow);
}
.tips-navigation button:hover {
  background: var(--brand);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(92,70,250,0.15);
}
.tips-navigation button:active {
  transform: translateY(0) scale(0.95);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
:root[data-theme="dark"] .tips-navigation button {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--brand-700);
}
:root[data-theme="dark"] .tips-navigation button:hover {
  background: var(--brand-700);
  color: #fff;
  box-shadow: 0 8px 20px rgba(100,118,255,0.2);
}

/* ===== Meter & strength ===== */
.bar-row{display:flex; align-items:center; gap:12px; margin:16px 0 2px}
.bar{flex:1; height:10px; border-radius:999px; background:#f0f2f7; position:relative; overflow:hidden}
:root[data-theme="dark"] .bar{background:#1f2a4a}

/* the fill element; width is set by JS */
.bar > span{
  position:absolute; top:0; bottom:0; left:0;  /* anchor to left by default */
  height:100%;
  transition:width .25s ease;
}

/* color states */
.meter--weak{background:linear-gradient(90deg,#fca5a5,#ef4444)}     /* red */
.meter--fair{background:linear-gradient(90deg,#fdba74,#f59e0b)}     /* orange */
.meter--good,.meter--strong{background:linear-gradient(90deg,#86efac,#10b981)} /* green */

/* pill (label) */
.pill{
  display:inline-flex; align-items:center; gap:6px; font-size:12px;
  padding:4px 8px; border-radius:999px; background:#fff5f511
}
.pill--weak{border:1px solid #fecaca44; color:#b91c1c}
.pill--fair{border:1px solid #fde68a55; color:#92400e}
.pill--strong{border:1px solid #bbf7d055; color:#065f46}
:root[data-theme="dark"] .pill--weak{color:#fecaca}
:root[data-theme="dark"] .pill--fair{color:#fbbf24}
:root[data-theme="dark"] .pill--strong{color:#34d399}

.score{font-size:13px; color:var(--muted); margin-top:8px}

/* ===== Points lists ===== */
.points{margin-top:18px}
.points-title{display:flex; align-items:center; gap:8px; margin:12px 0 6px; font-size:16px; font-weight:800}
.points-title.ok{color:var(--green)}
.points-title.warn{color:var(--orange)}
.points .dot{display:grid; place-items:center; width:18px; height:18px}
.points-list{list-style:none; padding:0; margin:0 0 12px 6px;}   
.points-list li{
  position:relative;
  padding:6px 0 6px 40px;   
  color:var(--text);
}
.points-list li .li-icon{
  position:absolute; left:8px; top:7px;  
  width:18px; height:18px; display:grid; place-items:center;
}
.points-list.ok li .li-icon{color:var(--green)}
.points-list.warn li .li-icon{color:var(--orange)}

/* ===== CTA ===== */
.cta-row{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:18px; padding-top:14px; border-top:1px solid var(--border)}
.btn{display:inline-flex; align-items:center; gap:10px; height:44px; padding:0 18px; border:none; border-radius:12px; cursor:pointer; background:linear-gradient(180deg,var(--brand),var(--brand-700)); color:#fff; font-weight:600; box-shadow:0 10px 18px rgba(92,70,250,.22)}

/* ===== Tips block ===== */
.tips{max-width:820px}
.tips .sec-title{display:flex; align-items:center; gap:10px; font-weight:700}
.tips .sec-title .shield{width:26px; height:26px; border-radius:8px; background:#eef2ff22; color:var(--brand); display:grid; place-items:center}

.tip-card.tip-grid{
  display:grid;
  grid-template-columns:48px 1fr;
  grid-template-rows:auto auto auto;
  grid-column-gap:14px;
  align-items:start;
  padding:14px;
  border:1px dashed var(--border);
  border-radius:14px;
  background:transparent;
  margin-top:12px;
}
.tip-icon{grid-column:1; grid-row:1; width:38px; height:38px; border-radius:12px; background:#ede9fe22; color:var(--brand); display:grid; place-items:center}
.tip-head{grid-column:2; grid-row:1}
.tip-title{font-weight:700; margin:0 0 8px 0;}
.tip-type{grid-column:2; grid-row:2; font-size:12px; color:var(--muted); letter-spacing:.08em; margin-bottom:2px;}
.tip-desc{grid-column:1 / span 2; grid-row:3; margin-top:10px}

.progress{margin-top:16px; font-size:13px; color:var(--muted); display:grid; grid-template-columns:1fr auto; align-items:center; gap:10px}
.progressbar{grid-column:1/-1; height:8px; border-radius:999px; background:#eef1f6; overflow:hidden}
:root[data-theme="dark"] .progressbar{background:#1f2a4a}
.progressbar span{display:block; height:100%; width:0%; transition:width .2s linear; background:linear-gradient(90deg,#a78bfa,#7c3aed)}
.tip-dots{grid-column:1/-1; display:flex; gap:6px; justify-content:flex-end; margin-top:4px}
.tip-dots .dot{width:8px; height:8px; border-radius:999px; background:#dbe1ee}
.tip-dots .dot.active{background:#7c3aed}

/* ===== Footer ===== */
.footer{max-width:820px; margin:28px auto 0; text-align:center; color:var(--muted); font-size:14px}
.footer .mini{margin-top:6px; font-size:13px}

/* ===== Responsive ===== */
@media (min-width: 720px){
  h1{font-size:44px}
}

/* ===================================================== */
/* ===============  RTL OVERRIDES (AT END)  ============ */
/* ===================================================== */

/* Apply when your JS sets: document.body.dir = 'rtl' */
body[dir="rtl"]{ direction: rtl; text-align: right; }

/* Labels / small texts alignment */
body[dir="rtl"] .label,
body[dir="rtl"] .card-sub,
body[dir="rtl"] .score{ text-align:right; }

/* Input padding flips in RTL: keep room on the left for affix buttons */
body[dir="rtl"] .input-wrap input[type="password"],
body[dir="rtl"] .input-wrap input[type="text"]{
  padding:0 14px 0 96px;
}

/* Move affix buttons to the left in RTL */
body[dir="rtl"] .affix{
  right:auto;
  left:4px;
}

/* Meter row: pill on the RIGHT of the bar in RTL */
body[dir="rtl"] .bar-row{ flex-direction: row-reverse; }

/* Meter fill grows from the RIGHT in RTL */
body[dir="rtl"] .bar > span{
  left:auto;
  right:0;
}

/* Points lists: bullets on right, text aligned right */
body[dir="rtl"] .points-list{ margin:0 6px 12px 0; }
body[dir="rtl"] .points-list li{
  padding:6px 40px 6px 0;
  text-align:right;
}
body[dir="rtl"] .points-list li .li-icon{
  left:auto;
  right:8px;
}

/* Points titles: keep icon + label together at the right */
body[dir="rtl"] .points-title{
  flex-direction: row-reverse;
  justify-content: flex-end;
  text-align: right;
}

/* Tips grid mirrors in RTL */
body[dir="rtl"] .tip-card.tip-grid{ grid-template-columns:1fr 48px; }
body[dir="rtl"] .tip-icon{ grid-column:2; grid-row:1 / span 2; }
body[dir="rtl"] .tip-head{ grid-column:1; grid-row:1; }
body[dir="rtl"] .tip-desc{ grid-column:1 / span 2; grid-row:3; margin-top:10px; }
body[dir="rtl"] .progress{ justify-content:end; }

/* Optional: flip header brand/actions sides in RTL
/*
 body[dir="rtl"] .header-inner{ flex-direction: row-reverse; } 
*/
  