/* =========================================================
   Naukriyan AI Interview  -  app.css
   Palette (logo se):  navy #2b2a6e   orange #e8621a
   Sirf system fonts; koi bahari file connect nahi hoti.
   ========================================================= */

:root {
  --navy: #2b2a6e;
  --navy-deep: #1f1e55;
  --navy-soft: #3a3990;
  --orange: #e8621a;
  --orange-deep: #c9500f;
  --orange-wash: #fff3ec;

  --bg: #f3f5fa;
  --surface: #ffffff;
  --ink: #1b1f3b;
  --muted: #646a85;
  --line: #dfe3ee;

  --accent: var(--orange);
  --warn: #b93c0a;
  --warn-bg: #fff1e8;
  --ok: #2a8a57;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 3px rgba(31, 30, 85, .08);
  --shadow: 0 10px 30px -8px rgba(31, 30, 85, .22);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  padding-bottom: 56px;               /* fixed "Powered by" bar ke liye jagah */
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}

/* =========================================================
   Header  (bada Naukriyan logo)
   ========================================================= */
.brand {
  background: #fff;
  padding: 12px 40px;
  border-bottom: 4px solid var(--orange);
  text-align: left;
}
.brand a { display: inline-block; line-height: 0; border-radius: 8px; }
.brand a:focus-visible { outline: 3px solid var(--navy); outline-offset: 4px; }
.brand img { height: 88px; width: auto; display: block; }

/* =========================================================
   Footer  (Powered by)
   ========================================================= */
.powered-by {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  padding: 13px 16px;
  text-align: center;
  font-size: 14px;
  letter-spacing: .01em;
  color: #cfd2ee;
  background: var(--navy-deep);
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.powered-by a {
  color: #ffb48c; font-weight: 700; text-decoration: none;
  border-bottom: 1px solid transparent; transition: border-color .2s, color .2s;
}
.powered-by a:hover { color: #fff; border-bottom-color: #ffb48c; }
.powered-by a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 3px; }

/* =========================================================
   Home page : hero + form card
   ========================================================= */
.hero {
  background: var(--navy);
  color: #fff;
  padding: 56px 20px 112px;
}
.hero-inner { max-width: 820px; margin: 0 auto; }

.hero .question {
  color: #fff;
  font-size: clamp(1.9rem, 4.4vw, 2.9rem);
  line-height: 1.15;
  letter-spacing: -.02em;
  font-weight: 800;
  max-width: 18ch;
  margin: 0 0 16px;
}
.hero .lead {
  color: #cfd2ee;
  font-size: 1.08rem;
  max-width: 56ch;
  margin: 0 0 34px;
}

/* teen kadam: yeh sach mein ek sequence hai, isliye numbering */
.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
}
.steps li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius-sm);
  font-size: .95rem; line-height: 1.4; color: #e9ebff;
}
.steps .n {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--orange); color: #fff; font-weight: 700; font-size: .85rem;
}

.home {
  max-width: 820px;
  margin: -64px auto 0;               /* form card hero ke upar tak chadhta hai */
  padding: 0 20px 56px;
  position: relative;
}
.home .answer-box { padding: 28px; border-radius: 16px; box-shadow: var(--shadow); }

.field-label {
  display: block; font-size: .92rem; font-weight: 700; color: var(--navy);
  margin: 0 2px 7px;
}
.field + .field { margin-top: 20px; }

.home input,
textarea {
  width: 100%;
  background: #fbfcfe;
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit; font-size: 1rem;
  padding: 13px 15px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.home input::placeholder, textarea::placeholder { color: #989db5; }
.home input:hover, textarea:hover { border-color: #c5cbe0; }
.home input:focus, textarea:focus {
  outline: none; background: #fff; border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(232, 98, 26, .16);
}
textarea { resize: vertical; min-height: 150px; line-height: 1.55; }
.home textarea { min-height: 200px; }

/* =========================================================
   Question / headings
   ========================================================= */
.question {
  font-weight: 800; color: var(--navy);
  font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.28; letter-spacing: -.01em;
  margin: 0 0 24px; max-width: 34ch;
}
.question.typing::after {
  content: ""; display: inline-block; width: 3px; height: 1em; margin-left: 4px;
  background: var(--orange); vertical-align: -.12em; animation: blink .9s steps(1) infinite;
}
.question.swap-out { opacity: 0; transform: translateY(-8px); transition: opacity .25s, transform .25s; }

/* =========================================================
   Card / answer box (home + room)
   ========================================================= */
.answer-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.room .answer-box:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(232, 98, 26, .12);
}
.room textarea { border: 0; background: transparent; padding: 6px; box-shadow: none; }
.room textarea:focus { box-shadow: none; background: transparent; }

.actions {
  display: flex; align-items: center; gap: 12px;
  margin-top: 22px;
}
.room .actions { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.hint { margin-left: auto; color: var(--muted); font-size: .88rem; }
.home .actions .btn.primary { margin-left: auto; }
.home .hint { margin-left: 0; }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  font: inherit; font-weight: 700; letter-spacing: .01em;
  border-radius: var(--radius-sm); padding: 12px 24px; cursor: pointer;
  border: 1.5px solid transparent; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s, background .18s, color .18s, border-color .18s, box-shadow .18s, opacity .18s;
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }

.btn.primary { background: var(--orange); color: #fff; box-shadow: 0 6px 16px -6px rgba(232, 98, 26, .65); }
.btn.primary:hover { background: var(--orange-deep); }
.btn.primary[disabled] { opacity: .6; cursor: wait; box-shadow: none; }

.btn.ghost { background: #fff; border-color: var(--navy); color: var(--navy); }
.btn.ghost:hover { background: var(--navy); color: #fff; }
.btn.ghost[hidden] { display: none; }

.home .btn.primary { padding: 14px 30px; font-size: 1.04rem; }

.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.btn.listening { border-color: var(--warn); color: var(--warn); }
.btn.listening .rec-dot { background: var(--warn); color: var(--warn); animation: pulse 1.1s ease-out infinite; }

.btn.loading::before {
  content: ""; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; animation: spin .8s linear infinite;
}

.error { color: var(--warn); margin: 10px 4px 0; font-size: .92rem; font-weight: 500; }

/* =========================================================
   Interview room
   ========================================================= */
.room {
  max-width: 1120px; margin: 0 auto; padding: 32px 20px 48px;
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px;
}
.stage-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.who { margin: 0; font-weight: 700; color: var(--navy); }
.count { margin: 0; color: var(--muted); font-size: .95rem; font-variant-numeric: tabular-nums; }

.progress { display: flex; gap: 6px; margin: 14px 0 30px; }
.progress span {
  height: 7px; flex: 1; border-radius: 4px; background: #dfe3ee;
  position: relative; overflow: hidden;
}
.progress span::after {
  content: ""; position: absolute; inset: 0; background: var(--orange);
  transform: scaleX(0); transform-origin: left; transition: transform .6s cubic-bezier(.2, .8, .2, 1);
}
.progress span.done::after { transform: scaleX(1); }
.progress span.now::after { transform: scaleX(.35); }

.question-wrap { min-height: 150px; }

/* ---------- Camera panel ---------- */
.side { position: sticky; top: 24px; align-self: start; }
.cam {
  position: relative; border-radius: var(--radius); overflow: hidden; background: #14163a;
  aspect-ratio: 4 / 3; border: 3px solid var(--line); transition: border-color .3s;
  box-shadow: var(--shadow-sm);
}
.cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.cam-off {
  position: absolute; inset: 0; display: grid; place-items: center;
  padding: 20px; text-align: center; color: #aab0d6; font-size: .9rem;
}
.cam.on .cam-off { display: none; }
.cam.ok { border-color: var(--ok); }
.cam.alert { border-color: var(--warn); animation: shake .45s; }

.status { display: flex; align-items: center; gap: 8px; margin: 12px 2px 0; color: var(--muted); font-size: .92rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.status.ok .dot { background: var(--ok); color: var(--ok); animation: pulse 2s ease-out infinite; }
.status.alert .dot { background: var(--warn); }

.warning {
  margin-top: 12px; padding: 12px 14px; border-radius: 10px;
  background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn);
  font-weight: 600; animation: slide-in .3s ease;
}
.warning[hidden] { display: none; }
.flags { margin: 12px 2px 0; color: var(--muted); font-size: .88rem; }

/* =========================================================
   Report
   ========================================================= */
.report { max-width: 800px; margin: 0 auto; padding: 40px 20px 64px; }
.report-head h1 { font-weight: 800; color: var(--navy); font-size: 2.1rem; letter-spacing: -.01em; margin: 4px 0 24px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 26px; margin-bottom: 18px; box-shadow: var(--shadow-sm);
}
.card h2 { margin: 0 0 12px; font-size: 1.12rem; color: var(--navy); }
.report-text { white-space: normal; }
.qa { padding: 16px 0; border-top: 1px solid var(--line); }
.qa:first-of-type { border-top: 0; }
.qa-top { display: flex; justify-content: space-between; gap: 16px; }
.qa-top h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.score {
  font-weight: 800; color: var(--orange-deep); white-space: nowrap;
  background: var(--orange-wash); padding: 2px 10px; border-radius: 999px; height: fit-content;
}
.qa-answer { margin: 8px 0 4px; }
.qa-feedback, .muted { color: var(--muted); margin: 0; font-size: .94rem; }
.event { margin: 6px 0; color: var(--warn); }

/* =========================================================
   Motion
   ========================================================= */
@keyframes blink { 50% { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes slide-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 860px) {
  .room { grid-template-columns: 1fr; }
  .side { position: static; order: -1; max-width: 320px; }
  .room .hint { display: none; }
  .room .actions .primary { margin-left: auto; }
}
@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr; }
  .hero { padding: 40px 20px 104px; }
  .hero .question { max-width: none; }
  .home .answer-box { padding: 20px; }
}
@media (max-width: 600px) {
  .brand { padding: 10px 16px; text-align: center; }
  .brand img { height: 64px; margin: 0 auto; }
  .home .actions { flex-direction: column; align-items: stretch; }
  .home .actions .btn.primary { margin-left: 0; width: 100%; }
  .home .hint { text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =========================================================
   Room / Report page ke extra styles
   ========================================================= */

/* interview ke time jagah bachane ke liye chhota header */
.brand--compact { padding: 8px 40px; }
.brand--compact img { height: 64px; }

/* question ke neeche "Listen" button */
.question-wrap .btn { margin-bottom: 22px; }

/* thank-you screen (JS isko hidden hata ke dikhata hai) */
.thanks {
  grid-column: 1 / -1;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 5px solid var(--orange);
  border-radius: 16px;
  padding: 64px 24px;
  box-shadow: var(--shadow);
}
.thanks[hidden], .stage[hidden], .side[hidden] { display: none; }
.thanks h1 { margin: 0 0 12px; color: var(--navy); font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 800; }
.thanks p { margin: 0; color: var(--muted); font-size: 1.1rem; }

/* report */
.report-head .who { font-size: 1rem; }
.report > .btn { margin-top: 6px; }

@media (max-width: 600px) {
  .brand--compact { padding: 8px 16px; }
  .brand--compact img { height: 52px; }
}

/* "This interview is being recorded" note */
.rec-note {
  display: flex; align-items: center; gap: 8px;
  margin: 8px 2px 0; font-size: .88rem; font-weight: 600; color: var(--warn);
}
.rec-note[hidden] { display: none; }
.rec-live {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--warn); color: var(--warn); animation: pulse 1.4s ease-out infinite;
}

/* =========================================================
   Already completed page
   ========================================================= */
.hero--short { padding-bottom: 96px; }
.hero--short .question { max-width: 24ch; }

.done-card { text-align: center; }

.done-icon {
  width: 64px; height: 64px; margin: 0 auto 16px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ok); color: #fff;
  font-size: 32px; font-weight: 800;
  box-shadow: 0 8px 20px -6px rgba(42, 138, 87, .55);
}
.done-title {
  margin: 0 0 10px; color: var(--navy);
  font-size: 1.4rem; font-weight: 800;
}
.done-text {
  margin: 0 auto 24px; max-width: 48ch;
  color: var(--muted); font-size: 1.02rem;
}

/* hero ke steps dark background ke liye bane the, yahan light card mein override */
.done-steps { text-align: left; margin-bottom: 8px; }
.done-steps li {
  background: var(--orange-wash);
  border-color: #f6d9c8;
  color: var(--ink);
}
.done-steps li:first-child { background: #eaf6ef; border-color: #bfe3cf; }
.done-steps li:first-child .n { background: var(--ok); }

.done-actions { justify-content: center; }
.home .done-actions .btn.primary { margin-left: 0; }