:root{
  --bg:#07111f;
  --surface:#0f172a;
  --card:#111c34;
  --border:#24324a;

  --accent:#3b82f6;
  --accent2:#60a5fa;

  --text:#e2e8f0;
  --muted:#94a3b8;

  --radius:18px;
}

*{
  box-sizing:border-box;
}

body{
  margin:0;
  min-height:100vh;

  background:var(--bg);
  color:var(--text);

  font-family:'DM Sans',sans-serif;

  overflow-x:hidden;
}

/* BACKGROUND EFFECT */

body::before{
  content:'';

  position:fixed;
  inset:0;

  background:
    radial-gradient(circle at top left,#2563eb33,transparent 35%),
    radial-gradient(circle at bottom right,#60a5fa22,transparent 35%);

  pointer-events:none;
  z-index:0;
}

.wrapper{
  position:relative;
  z-index:1;

  max-width:820px;

  margin:auto;

  padding:2rem 1.2rem 4rem;
}

/* HEADER */

header{
  text-align:center;
  margin-bottom:2.5rem;

  animation:fadeDown .6s ease;
}

.badge{
  display:inline-block;

  padding:.45rem 1rem;

  background:
    linear-gradient(
      135deg,
      #1d4ed8,
      #2563eb
    );

  border:1px solid #3b82f655;

  border-radius:999px;

  margin-bottom:1rem;

  font-size:.72rem;

  letter-spacing:.08em;

  color:#dbeafe;
}

h1{
  font-size:clamp(2.5rem,7vw,4rem);

  margin:0;

  line-height:1;

  font-family:'Playfair Display',serif;

  font-weight:900;
}

h1 span{
  display:block;
  color:var(--accent);
}

.subtitle{
  color:var(--muted);

  margin-top:1rem;

  font-size:.95rem;
}

/* CARD */

.form-card,
.result-card{

  background:
    linear-gradient(
      180deg,
      rgba(17,28,52,.95),
      rgba(15,23,42,.95)
    );

  backdrop-filter:blur(18px);

  border:1px solid var(--border);

  border-radius:var(--radius);

  padding:1.5rem;

  box-shadow:
    0 10px 40px rgba(0,0,0,.35);

  animation:fadeUp .6s ease;
}

.form-header{
  display:flex;
  justify-content:space-between;
  align-items:center;

  margin-bottom:1.2rem;
}

.form-header h2{
  margin:0;
  font-size:1.15rem;
}

.subject-count{
  font-size:.75rem;
  color:var(--muted);
}

/* SUBJECT GRID */

.subject-grid{
  display:grid;
  gap:1rem;
}

.subject-row{
  display:grid;
  grid-template-columns:1fr auto;

  gap:1rem;

  align-items:center;

  background:rgba(15,23,42,.8);

  border:1px solid transparent;

  padding:1rem;

  border-radius:14px;

  transition:.25s;
}

.subject-row:hover{
  border-color:#3b82f655;

  transform:translateY(-1px);

  background:#111c34;
}

.grade-select{

  background:#07111f;

  color:white;

  border:1px solid #334155;

  border-radius:10px;

  padding:.7rem .9rem;

  min-width:90px;

  font-size:.92rem;

  transition:.2s;

  outline:none;
}

.grade-select:focus{
  border-color:var(--accent);

  box-shadow:
    0 0 0 4px #3b82f622;
}

/* BUTTONS */

.actions{
  display:flex;
  gap:1rem;

  margin-top:1.3rem;
}

.btn{
  flex:1;

  padding:1rem;

  border:none;

  border-radius:12px;

  cursor:pointer;

  font-size:.95rem;

  font-weight:600;

  transition:.25s;
}

.btn:hover{
  transform:translateY(-2px);
}

.btn-primary{

  background:
    linear-gradient(
      135deg,
      #2563eb,
      #3b82f6
    );

  color:white;

  box-shadow:
    0 10px 30px #2563eb44;
}

.btn-primary:hover{
  box-shadow:
    0 14px 34px #2563eb66;
}

.btn-ghost{

  background:#0f172a;

  color:#dbeafe;

  border:1px solid #334155;
}

/* RESULT PANEL */

#result-panel{

  display:none;

  opacity:0;

  transform:translateY(20px);

  transition:.5s;

  margin-top:2rem;
}

#result-panel.show{
  display:block;

  opacity:1;

  transform:translateY(0);
}

.result-card{
  position:relative;
  overflow:hidden;
}

.result-card::before{
  content:'';

  position:absolute;

  top:0;
  left:0;
  right:0;

  height:4px;

  background:
    linear-gradient(
      90deg,
      #2563eb,
      #60a5fa
    );
}

.result-top{
  display:flex;
  justify-content:space-between;
  gap:2rem;

  flex-wrap:wrap;
}

.result-label{
  font-size:.72rem;

  text-transform:uppercase;

  letter-spacing:.08em;

  color:var(--muted);

  margin-bottom:.35rem;
}

.result-pct{

  font-size:clamp(3.5rem,10vw,5rem);

  line-height:1;

  color:var(--accent);

  font-family:'Playfair Display',serif;

  font-weight:900;
}

.result-points{
  font-size:1.6rem;
  font-weight:700;
}

.result-points span{
  font-size:1rem;
  color:var(--muted);
}

/* STATUS */

#result-status-badge{
  margin-top:1rem;
}

.result-status{

  display:inline-flex;

  padding:.45rem .9rem;

  border-radius:999px;

  font-size:.8rem;

  font-weight:600;
}

.status-pass{
  background:#172554;
  color:#93c5fd;
}

.status-fail{
  background:#450a0a;
  color:#fca5a5;
}

.status-supp{
  background:#422006;
  color:#fcd34d;
}

/* PROGRESS */

.progress-wrap{
  margin-top:2rem;
}

.progress-bar-bg{
  height:12px;

  background:#0f172a;

  border-radius:999px;

  overflow:hidden;

  border:1px solid #1e293b;
}

.progress-bar-fill{

  height:100%;

  width:0%;

  border-radius:999px;

  background:
    linear-gradient(
      90deg,
      #2563eb,
      #60a5fa
    );

  transition:width 1s cubic-bezier(.4,0,.2,1);

  box-shadow:
    0 0 20px #3b82f666;
}

/* ANIMATION */

@keyframes fadeDown{
  from{
    opacity:0;
    transform:translateY(-20px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}

@keyframes fadeUp{
  from{
    opacity:0;
    transform:translateY(20px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}

/* FOOTER */

.footer{

  margin-top:3rem;

  padding:2rem 1rem;

  border-top:1px solid #24324a;

  text-align:center;

  color:var(--muted);
}

.footer-content{

  max-width:700px;

  margin:auto;
}

.footer-title{

  font-size:1rem;

  font-weight:700;

  color:var(--text);

  margin-bottom:.7rem;
}

.footer-text{

  font-size:.9rem;

  line-height:1.7;

  margin-bottom:1rem;
}

.footer-contact{

  display:flex;

  justify-content:center;

  align-items:center;

  gap:.8rem;

  flex-wrap:wrap;

  font-size:.92rem;
}

.footer-contact a{

  color:#60a5fa;

  text-decoration:none;

  transition:.2s;
}

.footer-contact a:hover{

  color:white;
}

/* MOBILE */

@media(max-width:640px){

  .wrapper{
    padding:1.2rem .9rem 3rem;
  }

  .actions{
    flex-direction:column;
  }

  .result-top{
    flex-direction:column;
  }

  .subject-row{
    grid-template-columns:1fr;
  }

  .grade-select{
    width:100%;
  }

}