:root{
  --bg:#f3f3f3;
  --card:#ffffff;
  --text:#111;
  --muted:#6b6b6b;
  --line:#e8e8e8;

  --green:#b6f400;

  --blue:#2f80ff;
  --orange:#ff9a3c;
  --purple:#a05bff;
  --gray:#5e6b73;

  --shadow:0 18px 60px rgba(0,0,0,.10);
  --radius:22px;

  --bad:#dc2626;
  --good:#16a34a;
}

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

body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
}

.page{
  min-height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:36px 16px;
}

.shell{
  width:min(1100px, 100%);
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:34px 34px 26px;
}

.h1{
  margin:0;
  text-align:center;
  font-size:40px;
  letter-spacing:.2px;
}

.sub{
  margin:10px 0 0;
  text-align:center;
  color:var(--muted);
  font-size:14px;
  line-height:1.5;
}

.line{
  height:2px;
  background:var(--green);
  margin:18px 0 22px;
  border-radius:999px;
}

.tabs{
  display:flex;
  gap:14px;
  justify-content:center;
  flex-wrap:wrap;
  margin-bottom:22px;
}

.tab{
  text-decoration:none;
  color:#fff;
  font-weight:600;
  font-size:14px;
  padding:12px 18px;
  border-radius:12px;
  transition:transform .15s ease, filter .15s ease;
  box-shadow:0 10px 22px rgba(0,0,0,.10);
  border:1px solid rgba(255,255,255,.18);
}
.tab:hover{ transform:translateY(-2px); filter:brightness(1.02); }
.tab-blue{ background:var(--blue); }
.tab-gray{ background:var(--gray); }

.grid{
  display:grid;
  grid-template-columns: 1.35fr .95fr;
  gap:18px;
  align-items:start;
}
@media (max-width: 980px){
  .grid{ grid-template-columns: 1fr; }
}

.box{
  border-left:4px solid var(--green);
  padding:18px 18px;
  background:#fff;
  border-radius:16px;
}

.h2{
  margin:0 0 14px;
  font-size:22px;
}

.small{
  margin:0 0 14px;
  color:var(--muted);
  font-size:13px;
  line-height:1.45;
}

.form{
  display:grid;
  gap:12px;
}

.row2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
@media (max-width: 720px){
  .shell{ padding:24px 18px 18px; }
  .h1{ font-size:30px; }
  .tab{ width:100%; text-align:center; }
  .row2{ grid-template-columns:1fr; }
}

label{
  font-size:13px;
  color:var(--muted);
  display:block;
  margin-bottom:6px;
}

.field{
  margin:0;
}

input, select{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  font-size:14px;
  outline:none;
  background:#fff;
  color:var(--text);
}

input:focus, select:focus{
  border-color:rgba(47,128,255,.45);
  box-shadow:0 0 0 4px rgba(47,128,255,.10);
}

.hint{
  display:block;
  color:var(--muted);
  font-size:12px;
  margin-top:6px;
  line-height:1.4;
}

.err{
  min-height:18px;
  margin-top:6px;
  font-size:12px;
  color:var(--bad);
}

.is-bad{
  border-color:rgba(220,38,38,.7) !important;
  box-shadow:0 0 0 4px rgba(220,38,38,.10) !important;
}
.is-ok{
  border-color:rgba(22,163,74,.55) !important;
  box-shadow:0 0 0 4px rgba(22,163,74,.10) !important;
}

.actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:6px;
}

.btn{
  border:0;
  cursor:pointer;
  padding:12px 16px;
  border-radius:12px;
  font-weight:700;
  font-size:14px;
  transition:transform .15s ease, filter .15s ease;
}
.btn:hover{ transform:translateY(-2px); filter:brightness(1.02); }
.btn-accent{ background:var(--green); color:#111; }
.btn-ghost{
  background:#fff;
  border:1px solid var(--line);
  color:#111;
}

.result{
  margin-top:14px;
  background:#f7f7f7;
  border:1px solid var(--line);
  border-radius:16px;
  padding:16px;
}

.tests{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:10px;
}
@media (max-width: 520px){
  .tests{ grid-template-columns:1fr; }
}

.bar{
  height:10px;
  background:rgba(47,128,255,.12);
  border-radius:99px;
  overflow:hidden;
  margin-top:8px;
  border:1px solid rgba(47,128,255,.10);
}
#pbar{
  height:100%;
  width:0%;
  background:linear-gradient(90deg, rgba(47,128,255,.35), rgba(47,128,255,.9));
}

.code{
  margin: 12px 0 0;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  background:#f7f7f7;
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
  min-height:140px;
}
.footer{
  margin-top:26px;
  padding-top:18px;
  border-top:1px solid var(--line);
  text-align:center;
  color:var(--muted);
  font-size:13px;
}
