:root {
  --bg-darker: #191a21;
  --bg-dark: #21222c;
  --bg-panel: rgba(40, 42, 54, .68);
  --bg-panel-light: rgba(68, 71, 90, .4);
  --fg-main: #f8f8f2;
  --comment: #9aa6ca;
  --cyan: #8be9fd;
  --green: #50fa7b;
  --pink: #ff79c6;
  --purple: #bd93f9;
  --red: #ff5555;
  --yellow: #f1fa8c;
  --shadow-dark: 5px 5px 10px rgba(0, 0, 0, .5);
  --shadow-light: -5px -5px 10px rgba(255, 255, 255, .02);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; overflow-x: hidden; color: var(--fg-main); background: var(--bg-dark); font-family: Inter, sans-serif; }
button, input { font: inherit; }
h1, h2, h3 { font-family: Orbitron, sans-serif; letter-spacing: 1px; }
h1, h2, p { margin-top: 0; }
.hidden { display: none !important; }

.app-container { position: relative; isolation: isolate; width: min(1600px, 100%); min-height: 100vh; margin: 0 auto; padding: 20px; }
.glass-panel { border: 1px solid rgba(255, 255, 255, .05); border-top-color: rgba(255, 255, 255, .1); border-left-color: rgba(255, 255, 255, .1); border-radius: 16px; background: var(--bg-panel); box-shadow: 0 8px 32px rgba(0, 0, 0, .3); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.glass-panel-inner { border: 1px solid rgba(255, 255, 255, .03); border-radius: 12px; background: var(--bg-panel-light); box-shadow: inset 2px 2px 5px rgba(0, 0, 0, .2), inset -2px -2px 5px rgba(255, 255, 255, .02); }

header { position: relative; overflow: hidden; padding: 20px 30px; }
.header-content { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.title-area h1 { margin: 0 0 5px; color: var(--cyan); font-size: 2rem; text-shadow: 0 0 10px rgba(139, 233, 253, .3); }
.title-area h2 { margin: 0; color: var(--fg-main); font-size: 1.2rem; font-weight: 500; }
.title-area h3 { margin: 5px 0 0; color: var(--comment); font-size: .9rem; }
.contact-area { display: flex; gap: 15px; padding: 15px; }
.cyber-line { position: absolute; right: 0; bottom: 0; left: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--pink), var(--purple), transparent); box-shadow: 0 0 10px var(--pink); }

.glass-btn, button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 18px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 8px; color: var(--fg-main); background: rgba(255, 255, 255, .05); box-shadow: var(--shadow-dark), var(--shadow-light); font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .3s ease, color .3s ease, border-color .3s ease, background .3s ease, box-shadow .3s ease; }
.glass-btn:hover, button:hover { transform: translateY(-2px); color: var(--cyan); border-color: var(--cyan); background: rgba(255, 255, 255, .1); box-shadow: 0 0 15px rgba(139, 233, 253, .3); }
button:focus-visible, input:focus-visible, .glass-btn:focus-visible { outline: 3px solid rgba(139, 233, 253, .35); outline-offset: 3px; }
button:disabled { opacity: .65; cursor: wait; transform: none; }

.correction-content { width: min(1040px, 100%); margin: 0 auto; padding: 42px 0 20px; }
.intro { display: flex; align-items: center; gap: 24px; max-width: 850px; margin: 0 0 28px; }
.intro-icon { display: grid; flex: 0 0 auto; place-items: center; width: 92px; height: 92px; border: 1px solid rgba(139, 233, 253, .18); border-radius: 50%; color: var(--cyan); background: rgba(139, 233, 253, .06); box-shadow: 0 0 30px rgba(139, 233, 253, .1); font-size: 2.7rem; }
.eyebrow { margin: 0 0 7px; color: var(--pink); font-family: Orbitron, sans-serif; font-size: .78rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.intro h1 { margin-bottom: 10px; color: var(--cyan); font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1.1; text-shadow: 0 0 10px rgba(139, 233, 253, .22); }
.intro > div > p:last-child { margin: 0; color: var(--comment); font-size: 1.03rem; line-height: 1.65; }

.card, .result-summary { margin-bottom: 20px; padding: clamp(20px, 4vw, 32px); }
.lookup-card > div:first-child, .heading-copy { display: flex; align-items: center; gap: 14px; }
.step { display: grid; flex: 0 0 auto; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--bg-darker); background: linear-gradient(135deg, var(--pink), var(--purple)); box-shadow: 0 0 18px rgba(189, 147, 249, .3); font-family: Orbitron, sans-serif; font-weight: 900; }
h2 { margin-bottom: 4px; color: var(--purple); font-size: clamp(1.15rem, 3vw, 1.55rem); }
.lookup-card p, .section-heading p { margin-bottom: 0; color: var(--comment); }
.lookup-form { margin-top: 24px; }
label { display: block; margin-bottom: 8px; font-size: .88rem; font-weight: 700; }
.input-action { display: grid; grid-template-columns: 1fr auto; gap: 12px; }
#exam-code { width: 100%; min-width: 0; padding: 12px 15px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 8px; color: var(--fg-main); background: rgba(0, 0, 0, .24); box-shadow: inset 2px 2px 6px rgba(0, 0, 0, .3); text-transform: uppercase; transition: border-color .2s ease, box-shadow .2s ease; }
#exam-code:focus { border-color: var(--cyan); box-shadow: inset 2px 2px 6px rgba(0, 0, 0, .3), 0 0 12px rgba(139, 233, 253, .14); }
.input-action button, #grade-button, #new-exam { color: var(--bg-darker); border-color: transparent; background: linear-gradient(135deg, var(--cyan), var(--green)); box-shadow: 0 0 18px rgba(139, 233, 253, .18); }
.input-action button:hover, #grade-button:hover, #new-exam:hover { color: var(--bg-darker); border-color: transparent; box-shadow: 0 0 22px rgba(80, 250, 123, .3); }
.status { min-height: 21px; margin: 14px 0 0 !important; color: var(--red) !important; }
.status:empty { display: none; }
.status.loading { color: var(--cyan) !important; }
.status.unavailable, .status.not-found { display: flex; align-items: center; gap: 14px; padding: 15px 17px; border: 1px solid rgba(241, 250, 140, .2); border-left: 4px solid var(--yellow); border-radius: 10px; color: var(--fg-main) !important; background: rgba(241, 250, 140, .07); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 8px 20px rgba(0, 0, 0, .16); line-height: 1.5; }
.status-icon { display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(241, 250, 140, .25); border-radius: 50%; color: var(--yellow); background: rgba(241, 250, 140, .08); font-size: 1rem; }
.status.not-found { border-color: rgba(255, 85, 85, .22); border-left-color: var(--red); background: rgba(255, 85, 85, .08); }
.status.not-found .status-icon { border-color: rgba(255, 85, 85, .28); color: var(--red); background: rgba(255, 85, 85, .1); }

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.pill { flex: 0 0 auto; padding: 7px 12px; border: 1px solid rgba(139, 233, 253, .25); border-radius: 999px; color: var(--cyan); background: rgba(139, 233, 253, .09); font-size: .82rem; font-weight: 700; }
.answer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.answer-row { display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 11px; min-width: 0; padding: 12px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 10px; background: rgba(0, 0, 0, .18); }
.question-number { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; color: var(--pink); background: rgba(255, 121, 198, .08); font-family: Orbitron, sans-serif; }
.choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.choice { margin: 0; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: grid; place-items: center; min-height: 38px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 7px; color: var(--comment); background: rgba(255, 255, 255, .025); cursor: pointer; transition: all .2s ease; }
.choice span:hover { color: var(--cyan); border-color: rgba(139, 233, 253, .5); }
.choice input:checked + span { color: var(--bg-darker); border-color: var(--green); background: linear-gradient(135deg, var(--cyan), var(--green)); box-shadow: 0 0 12px rgba(80, 250, 123, .2); }
.choice input:focus-visible + span { outline: 3px solid rgba(139, 233, 253, .35); outline-offset: 2px; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .08); }
.form-footer p { margin: 0; color: var(--comment); font-size: .88rem; }

.result-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-color: rgba(139, 233, 253, .24); }
.result-summary p:last-child { margin: 0; color: var(--comment); }
.score { flex: 0 0 auto; text-align: right; }
.score strong { display: block; color: var(--cyan); font-family: Orbitron, sans-serif; font-size: clamp(2.6rem, 8vw, 4.5rem); line-height: .9; text-shadow: 0 0 15px rgba(139, 233, 253, .25); }
.score span { color: var(--comment); }
.feedback-list { display: grid; gap: 12px; }
.feedback-item { padding: 18px 20px; border: 1px solid rgba(255, 255, 255, .07); border-left: 4px solid; border-radius: 12px; background: var(--bg-panel); box-shadow: 0 8px 24px rgba(0, 0, 0, .22); backdrop-filter: blur(12px); }
.feedback-item.correct { border-left-color: var(--green); }
.feedback-item.wrong { border-left-color: var(--red); }
.feedback-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.feedback-head strong { color: var(--fg-main); font-family: Orbitron, sans-serif; }
.feedback-state { color: var(--green); font-size: .85rem; font-weight: 800; }
.wrong .feedback-state { color: var(--red); }
.feedback-answer { margin-bottom: 9px; color: var(--comment); font-size: .9rem; }
.feedback-answer strong { color: var(--yellow); }
.feedback-text { margin: 0; line-height: 1.55; }
.result-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }
.secondary { color: var(--fg-main); background: var(--bg-panel-light); }

footer { padding: 16px 16px 8px; color: var(--comment); text-align: center; font-size: .82rem; }
.bg-shape { position: fixed; z-index: -1; border-radius: 50%; opacity: .5; filter: blur(90px); animation: float 20s infinite ease-in-out; pointer-events: none; }
.circle-1 { top: -100px; left: -100px; width: 400px; height: 400px; background: var(--purple); }
.circle-2 { right: -50px; bottom: -50px; width: 300px; height: 300px; background: var(--cyan); animation-delay: -5s; }
.circle-3 { top: 50%; left: 50%; width: 250px; height: 250px; background: var(--pink); animation-delay: -10s; }
@keyframes float { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(30px) scale(1.1); } }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 700px) {
  .app-container { padding: 10px; }
  header { padding: 18px; }
  .header-content { align-items: flex-start; flex-direction: column; }
  .title-area h1 { font-size: 1.5rem; }
  .contact-area, .contact-area .glass-btn { width: 100%; }
  .correction-content { padding-top: 28px; }
  .intro { align-items: flex-start; gap: 14px; }
  .intro-icon { width: 54px; height: 54px; font-size: 1.5rem; }
  .input-action, .answer-grid { grid-template-columns: 1fr; }
  .input-action button { width: 100%; }
  .section-heading, .form-footer, .result-summary { align-items: flex-start; flex-direction: column; }
  .score { text-align: left; }
  .result-actions { flex-direction: column; }
  .form-footer button, .result-actions button { width: 100%; }
}

@media (prefers-reduced-motion: no-preference) {
  .card, .result-summary, .feedback-item { animation: enter .35s ease both; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bg-shape { animation: none; }
}
