/* ============================================================
   TypingSathi — css/exam.css
   परीक्षा पृष्ठ (mock.html)  ·  अकेला चलता है, app.css की ज़रूरत नहीं
   EduXtreme
   ============================================================ */

/* Poppins — अपने ही server से (font/ फ़ोल्डर), हिन्दी + English दोनों */
@font-face { font-family: 'Poppins'; font-weight: 400; font-display: swap; src: url('../font/Poppins-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 500; font-display: swap; src: url('../font/Poppins-Medium.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 600; font-display: swap; src: url('../font/Poppins-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 700 800; font-display: swap; src: url('../font/Poppins-Bold.woff2') format('woff2'); }

/* [hidden] हमेशा छिपे — किसी class का display उसे न काटे */
[hidden] { display: none !important; }

@font-face {
  font-family: 'KrutiDev';
  src: local('Kruti Dev 010'), local('KrutiDev010'),
       url('../font/KrutiDev010.TTF') format('truetype');
  font-display: block;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:  #e8622a;  --brand-d: #cc5220;  --brand-s: #fff1ea;
  --ink:    #1f2733;  --muted:   #6b7280;  --faint:  #6f7787;
  --page:   #f7f8fb;  --panel:   #ffffff;  --line:   #eceef3;  --edge: #dfe3ea;
  --ok:     #16a34a;  --bad:     #dc2626;  --amber:  #d97706;
  --r: 14px; --r-sm: 10px;
}

body {
  font-family: 'Poppins', system-ui, sans-serif;
  background: var(--page); color: var(--ink); font-size: 14px;
  height: 100vh; display: flex; flex-direction: column; overflow: hidden;
}

.num { font-family: 'Poppins', system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.en  { font-family: 'Poppins', system-ui, sans-serif; }
.kruti { font-family: 'KrutiDev', serif; }

/* ============================================================
   exam bar
   ============================================================ */
.bar {
  background: var(--panel); border-bottom: 1px solid var(--line);
  padding: 10px 22px; display: flex; align-items: center; gap: 20px;
  flex: none; flex-wrap: wrap;
}
.bar .brand { display: flex; align-items: center; gap: 11px; }
.bar .mark {
  width: 38px; height: 38px; flex: none; border-radius: 10px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.bar .brand b { font-family: 'Poppins', sans-serif; font-size: 16px; font-weight: 700; display: block; }
.bar .brand b i { font-style: normal; color: var(--brand); }
.bar .brand span { font-size: 12px; color: var(--faint); display: block; margin-top: 1px; }

.meta { display: flex; align-items: center; gap: 20px; margin-left: auto; flex-wrap: wrap; }
.meta .c { text-align: center; min-width: 66px; }
.meta .c .k { font-size: 11px; letter-spacing: .7px; text-transform: uppercase; color: var(--faint); }
.meta .c .v { font-size: 18px; font-weight: 700; margin-top: 1px; }
.meta .c .v.ok { color: var(--ok); }

.clock {
  background: var(--brand-s); border: 1px solid #f6d3c1; border-radius: var(--r-sm);
  padding: 6px 18px; font-size: 28px; font-weight: 700; color: var(--brand-d);
  font-family: 'Poppins', sans-serif; font-variant-numeric: tabular-nums;
}
.clock.warn   { background: #fef4e6; border-color: #f6dda8; color: #a86a0c; }
.clock.danger { background: #fdeaea; border-color: #f3c0c0; color: #b41f1f;
                animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .5; } }

.prog { height: 5px; background: #e9ecf1; flex: none; }
.prog > i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .3s; }
.prog > i.behind { background: var(--amber); }

/* ============================================================
   panels
   ============================================================ */
.wrap { flex: 1; padding: 14px 22px 16px 22px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }

.pane {
  flex: 1; min-height: 0; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r);
  display: flex; flex-direction: column; overflow: hidden;
}
.pane > header {
  padding: 9px 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; flex: none;
}
.pane > header b { font-size: 13px; font-weight: 700; color: var(--muted);
                   letter-spacing: .5px; text-transform: uppercase; }
.pane > header .r { margin-left: auto; font-size: 13px; color: var(--muted); }

#paper {
  flex: 1; overflow-y: auto; padding: 12px 20px;
  font-size: 24px; line-height: 1.6; letter-spacing: .3px;
  white-space: pre-wrap; word-break: break-word;
  text-align: justify; text-justify: inter-word;
  user-select: none; -webkit-user-select: none;
}
#paper .ch.done { background: #d7f0e0; }
#paper .ch.err  { background: #fbd5d5; color: #8b1a1a; }
#paper .ch.cur  { background: var(--brand); color: #fff; border-radius: 3px; }

/* ---------- शब्द-highlight (अक्षर-highlight से स्वतन्त्र) ---------- */
#paper .ch.wok   { color: #15803d; }
#paper .ch.wbad  { background: #fde2e2; color: #b91c1c;
                   text-decoration: underline wavy #dc2626; text-underline-offset: 6px; }
#paper .ch.wskip { background: #fef3c7; color: #92400e;
                   text-decoration: underline dashed #d97706; text-underline-offset: 6px; }
/* अक्षर-highlight भी चालू हो तो उसका रंग ऊपर रहे */
#paper .ch.done.wbad, #paper .ch.done.wskip { background: #d7f0e0; }
#paper .ch.err  { background: #fbd5d5; color: #8b1a1a; }
#paper .ch.cur  { background: var(--brand); color: #fff; }

#typeArea {
  flex: 1; width: 100%; border: 0; outline: 0; resize: none;
  padding: 14px 20px; font-size: 24px; line-height: 1.6; letter-spacing: .3px;
  background: #fffdf7; color: var(--ink);
}
#typeArea:disabled { background: #f4f5f8; color: var(--muted); }

.foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; flex: none; }
.note { font-size: 13px; color: var(--muted); }

/* ============================================================
   buttons
   ============================================================ */
.btn {
  border: 0; border-radius: var(--r-sm); padding: 0 20px; height: 46px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: 'Poppins', system-ui, sans-serif;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-d); }
.btn-line { background: #fff; border: 1px solid var(--edge); color: var(--ink); font-weight: 500; }
.btn-line:hover { background: #f6f7fa; }
.btn-sm { height: 38px; padding: 0 14px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13px;
          color: var(--muted); cursor: pointer; }
.toggle input { accent-color: var(--brand); }

/* ============================================================
   overlays
   ============================================================ */
.ov {
  position: fixed; inset: 0; background: rgba(25,30,40,.55);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.ov[hidden] { display: none; }

.sheet {
  background: #fff; border-radius: var(--r); width: 100%; max-width: 640px;
  max-height: 92vh; overflow-y: auto; box-shadow: 0 24px 60px rgba(20,25,35,.3);
  padding: 26px 30px 24px 30px;
}
.sheet h2 { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.sheet .sub { font-size: 13px; color: var(--muted); margin: 5px 0 18px 0; }
.sheet ul { margin: 0 0 18px 20px; font-size: 14px; line-height: 2; }
.sheet .row {
  display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap;
  justify-content: center;          /* निर्देश तथा परिणाम के बटन बीच में */
}

.setup { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px,1fr)); gap: 11px; margin-bottom: 18px; }
.setup .c { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; }
.setup .c .k { font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: var(--faint); }
.setup .c .v { font-size: 20px; font-weight: 700; margin-top: 2px; }

.verdict { text-align: center; padding: 18px; border-radius: var(--r-sm); margin-bottom: 18px; }
.verdict.pass { background: #eaf7ef; border: 1px solid #b9e2cb; }
.verdict.fail { background: #fdeeee; border: 1px solid #f3c4c4; }
.verdict .big { font-size: 28px; font-weight: 800; letter-spacing: .5px; }
.verdict.pass .big { color: var(--ok); }
.verdict.fail .big { color: var(--bad); }
.verdict .small { font-size: 13px; color: var(--muted); margin-top: 3px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px,1fr)); gap: 11px; }
.stat { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 13px; }
.stat .k { font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: var(--faint); }
.stat .v { font-size: 20px; font-weight: 700; margin-top: 2px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: #9b1c1c; color: #fff; padding: 11px 22px; border-radius: var(--r-sm);
  font-size: 14px; z-index: 60; box-shadow: 0 10px 30px rgba(20,25,35,.3);
  max-width: 90vw; text-align: center;
}
.toast[hidden] { display: none; }

@media (max-width: 860px) {
  #paper, #typeArea { font-size: 19px; line-height: 1.55; }
  .clock { font-size: 20px; padding: 4px 12px; }
  .meta { gap: 12px; }
  .meta .c { min-width: 54px; }
  .meta .c .v { font-size: 16px; }
  .bar .brand span { display: none; }
}


/* ---------- परिणाम : शब्द ---------- */
.rwords {
  margin-top: 14px; padding: 11px 14px; border-radius: var(--r-sm);
  background: #f7f8fb; border: 1px solid var(--line); font-size: 14px; line-height: 1.8;
}
.rwords b { font-weight: 700; }
.rwords small { display: block; color: var(--muted); font-size: 12px; }
.whltag {
  display: inline-block; margin-left: 10px; font-size: 12px; font-weight: 700;
  background: #e0ecff; color: #1d4ed8; border-radius: 20px; padding: 2px 10px;
}
.whltag.off { background: #eef0f4; color: var(--muted); }

/* ---------- लोगो (icons/logo.svg जैसा, पृष्ठ में ही) ---------- */
.mark { background: none !important; padding: 0; overflow: visible; }
.mark svg.logo { width: 100%; height: 100%; display: block; }
