:root{
  --maroon: #800000;
  --maroon-dark: #260000;
  --bg: #f6f3f3;
  --card: #ffffff;
  --text: #1b1b1b;
  --muted: #6b6b6b;
  --line: rgba(0,0,0,.08);
  --ring: rgba(128,0,0,.25);
  --shadow: 0 10px 30px rgba(0,0,0,.08);
  --radius: 16px;
  --radius-sm: 12px;
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 500px at 15% 0%, rgba(128,0,0,.14), transparent 60%),
              radial-gradient(1200px 500px at 85% 0%, rgba(38,0,0,.12), transparent 60%),
              var(--bg);
}

.container{
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.topbar{
  background: linear-gradient(120deg, var(--maroon), var(--maroon-dark));
  color:#fff;
  padding: 18px 0;
  box-shadow: 0 8px 25px rgba(38,0,0,.25);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand{
  display:flex;
  gap:14px;
  align-items:center;
}
.brand h1{
  margin:0;
  font-size: 18px;
  letter-spacing: .2px;
}
.brand p{
  margin:4px 0 0;
  opacity: .9;
  font-size: 13px;
}

.brand-mark{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  position: relative;
}
.brand-mark::after{
  content:"";
  position:absolute;
  inset: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.16);
}

.note{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:10px;
}
.topbar .container{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap:16px;
}

.pill{
  display:inline-flex;
  align-items:center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.20);
  font-size: 12px;
  white-space: nowrap;
}

.card{
  margin: 20px 0 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section{
  padding: 18px 18px 22px;
  border-top: 1px solid var(--line);
}
.section:first-child{ border-top: 0; }

.section-head{
  display:flex;
  align-items:flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.section-head h2{
  margin:0;
  font-size: 16px;
}
.section-head p{ margin:0; }

.row-between{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
}

.req{ color: var(--maroon); font-weight: 700; }
.muted{ color: var(--muted); font-size: 13px; }
.hint{ margin: 8px 0 0; color: var(--muted); font-size: 12px; }

.grid{
  display:grid;
  gap: 12px;
}
.grid-2{ grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3{ grid-template-columns: repeat(3, minmax(0,1fr)); }
.nested{ align-content: start; }

.field label{
  display:block;
  font-weight: 600;
  font-size: 13px;
  margin: 0 0 6px;
}
.field input, .field select, .field textarea{
  width:100%;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 12px;
  background: #fff;
  outline: none;
  transition: box-shadow .15s, border-color .15s;
}
.field textarea{ resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus{
  border-color: rgba(128,0,0,.35);
  box-shadow: 0 0 0 4px var(--ring);
}

.error{
  display:block;
  min-height: 16px;
  margin-top: 6px;
  font-size: 12px;
  color: #b00020;
}

.chips{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(128,0,0,.04);
  cursor:pointer;
  user-select:none;
  font-size: 13px;
}
.chip input{ margin:0; }

.subcard{
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(128,0,0,.04), rgba(0,0,0,0));
  overflow:hidden;
}
.subcard-head{
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
}
.subcard-head h3{
  margin:0 0 10px;
  font-size: 14px;
}

.table-wrap{ overflow:auto; }
.table{
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
.table th, .table td{
  border-top: 1px solid var(--line);
  padding: 10px 10px;
  vertical-align: middle;
  text-align: left;
  font-size: 13px;
  background:#fff;
}
.table thead th{
  position: sticky;
  top: 0;
  background: #fff7f7;
  border-top: 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #4a2a2a;
}
.table td input, .table td select{
  width:100%;
  padding: 8px 10px;
  border-radius: 10px;
}

.stack{
  display:flex;
  flex-direction: column;
  gap: 12px;
}
.ref-card{
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: #fff;
}
.ref-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.ref-head strong{ font-size: 13px; }

.btn{
  appearance:none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 13px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap: 8px;
  transition: transform .05s, filter .15s, box-shadow .15s;
}
.btn:active{ transform: translateY(1px); }
.btn .icon{
  display:inline-flex;
  width: 22px;
  height: 22px;
  align-items:center;
  justify-content:center;
  border-radius: 8px;
  background: rgba(128,0,0,.12);
  color: var(--maroon);
  font-weight: 900;
}

.btn-primary{
  background: linear-gradient(120deg, var(--maroon), var(--maroon-dark));
  color:#fff;
  box-shadow: 0 10px 22px rgba(38,0,0,.18);
}
.btn-primary:hover{ filter: brightness(1.05); }

.btn-outline{
  background: #fff;
  border-color: rgba(128,0,0,.25);
  color: var(--maroon);
}
.btn-outline:hover{ box-shadow: 0 0 0 4px var(--ring); }

.btn-ghost{
  background: transparent;
  border-color: rgba(0,0,0,.12);
  color: #333;
}
.btn-ghost:hover{ box-shadow: 0 0 0 4px rgba(0,0,0,.06); }

.actions{
  display:flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  background: linear-gradient(180deg, rgba(128,0,0,.04), transparent);
}

.json{
  margin:0;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0b0b0b;
  color: #e9e9e9;
  overflow:auto;
  max-height: 420px;
  font-size: 12px;
}

.footer{
  margin-bottom: 30px;
  text-align:center;
}

@media (max-width: 900px){
  .topbar .container{ flex-direction: column; align-items:flex-start; }
  .grid-2, .grid-3{ grid-template-columns: 1fr; }
  .actions{ justify-content: stretch; }
  .actions .btn{ flex: 1; justify-content:center; }
}

/* keep chips in a row */
.chips{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:center;
}

/* pill */
.chip{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:12px 18px;
  border:1px solid rgba(0,0,0,.12);
  border-radius:999px;
  background: rgba(128,0,0,.04);
  cursor:pointer;
  user-select:none;
  white-space:nowrap;

  /* IMPORTANT: create left space for custom circle */
  padding-left: 44px;
}

/* hide the real radio but keep it clickable (label handles click) */
.chip input[type="radio"]{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

/* custom circle on the left */
.chip::before{
  content:"";
  position:absolute;
  left:18px;
  top:50%;
  transform:translateY(-50%);
  width:16px;
  height:16px;
  border-radius:50%;
  border:2px solid rgba(0,0,0,.45);
  background:#fff;
}

/* checked state */
.chip:has(input[type="radio"]:checked)::before{
  border-color:#800000;
  box-shadow: inset 0 0 0 4px #800000;
}

/* optional selected pill */
.chip:has(input[type="radio"]:checked){
  border-color: rgba(128,0,0,.35);
  background: rgba(128,0,0,.10);
  font-weight:700;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.4;
}

.check input[type="checkbox"] {
  position: static !important;  /* override any absolute positioning */
  margin: 3px 0 0 0;
  width: auto;
}


/* =========================
   BETTER SECTION SEPARATION
   ========================= */

.section{
  position: relative;
  margin: 18px 18px 22px;
  padding: 22px 22px 24px;
  border: 1px solid rgba(128,0,0,.10);
  border-left: 5px solid var(--maroon);
  border-radius: 16px;
  background: linear-gradient(180deg, #fffefe 0%, #fcf7f7 100%);
  box-shadow: 0 6px 18px rgba(38,0,0,.05);
}

/* first section spacing */
.section:first-child{
  margin-top: 18px;
}

/* spacing between sections */
.section + .section{
  margin-top: 20px;
}

/* alternate section tone */
.section:nth-of-type(even){
  background: linear-gradient(180deg, #fffdf8 0%, #fff9f0 100%);
  border-color: rgba(128,0,0,.08);
  border-left-color: #c89b3c;
}

/* section heading */
.section-head{
  display:flex;
  align-items:flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(128,0,0,.18);
}

.section-head h2{
  margin:0;
  font-size: 17px;
  color: var(--maroon);
  font-weight: 700;
  letter-spacing: .2px;
}

.section:nth-of-type(even) .section-head h2{
  color: #8b5e00;
}

.section-head p{
  margin:0;
}

/* for sections with add buttons */
.section-head.row-between{
  align-items: center;
}

/* inner blocks */
.subcard{
  margin-top: 14px;
  border: 1px solid rgba(128,0,0,.08);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(128,0,0,.03), rgba(255,255,255,1));
  overflow:hidden;
}

/* subcard headings */
.subcard-head{
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(128,0,0,.08);
  background: rgba(128,0,0,.03);
}

/* =========================
   LAST TWO SECTIONS PLAIN
   ========================= */

/* recaptcha section plain */
.section:nth-last-of-type(2){
  background: transparent !important;
  border: 0 !important;
  border-left: 0 !important;
  box-shadow: none !important;
  margin-top: 8px;
  margin-bottom: 8px;
  padding-top: 8px;
  padding-bottom: 8px;
}

/* submit section plain */
.section:last-of-type{
  background: transparent !important;
  border: 0 !important;
  border-left: 0 !important;
  box-shadow: none !important;
  margin-top: 8px;
  padding-top: 8px;
  padding-bottom: 8px;
}

/* remove heading divider in last two sections */
.section:nth-last-of-type(2) .section-head,
.section:last-of-type .section-head{
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

/* remove any background from action area */
.section:last-of-type.actions,
.section:last-of-type .actions{
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* remove pseudo border if any */
.section:nth-last-of-type(2)::before,
.section:last-of-type::before{
  display: none !important;
}

/* =========================
   MOBILE
   ========================= */

@media (max-width: 900px){
  .section{
    margin: 14px 12px 18px;
    padding: 18px 16px 20px;
  }

  .section + .section{
    margin-top: 16px;
  }

  .section-head{
    align-items: flex-start;
    flex-direction: column;
  }
}

/* move select arrow a little to the left */
.field select{
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  padding-right: 52px;

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%231b1b1b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M5 7l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
}

/* move all add buttons to right */
.row-between{
  justify-content: flex-end;
}

.row-between .btn,
.row-between button{
  margin-left: auto;
}

/* =========================
   MOBILE FRIENDLY TABLES
   ========================= */
@media (max-width: 768px){

  .table-wrap{
    overflow: visible;
    margin-top: 20px;
    padding: 10px;
  }

  .table{
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
  }

  .table thead{
    display: none;
  }

  .table,
  .table tbody,
  .table tr,
  .table td{
    display: block;
    width: 100%;
  }

  .table tr{
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid rgba(128,0,0,.10);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(38,0,0,.05);
  }

  .table td{
    border: 0;
    padding: 6px 0;
    background: transparent !important;
  }

  .table td:first-child{
    padding-top: 0;
  }

  .table td:last-child{
    padding-bottom: 0;
  }

  .table td input,
  .table td select,
  .table td textarea{
    width: 100%;
  }

  /* O/L and A/L numbering cell */
  #olRows td:first-child,
  #alRows td:first-child{
    font-weight: 700;
    font-size: 13px;
    color: var(--maroon);
    margin-bottom: 4px;
  }

  /* label before each mobile field */
  #olRows tr td:nth-child(2)::before{
    content: "Subject";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  #olRows tr td:nth-child(3)::before{
    content: "Grade";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  #alRows tr td:nth-child(2)::before{
    content: "Subject";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  #alRows tr td:nth-child(3)::before{
    content: "Grade";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  /* Degree */
  #degreeBody tr td:nth-child(1)::before{
    content: "Degree";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  #degreeBody tr td:nth-child(2)::before{
    content: "University";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  #degreeBody tr td:nth-child(3)::before{
    content: "Year";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  #degreeBody tr td:nth-child(4)::before{
    content: "Class / Division";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  /* Diploma */
  #diplomaBody tr td:nth-child(1)::before{
    content: "Diploma Name";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  #diplomaBody tr td:nth-child(2)::before{
    content: "Institute";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  #diplomaBody tr td:nth-child(3)::before{
    content: "Year";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  #diplomaBody tr td:nth-child(4)::before{
    content: "Duration";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  /* Certification */
  #certBody tr td:nth-child(1)::before{
    content: "Course Name";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  #certBody tr td:nth-child(2)::before{
    content: "Institution";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  #certBody tr td:nth-child(3)::before{
    content: "Duration";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  #certBody tr td:nth-child(4)::before{
    content: "Year";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  /* Other Higher Education */
  #otherEduBody tr td:nth-child(1)::before{
    content: "Qualification Type";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  #otherEduBody tr td:nth-child(2)::before{
    content: "Institution";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  #otherEduBody tr td:nth-child(3)::before{
    content: "Year";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  #otherEduBody tr td:nth-child(4)::before{
    content: "Result";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  /* Professional qualifications */
  #profBody tr td:nth-child(1)::before{
    content: "Qualification Name";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  #profBody tr td:nth-child(2)::before{
    content: "Institution";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  #profBody tr td:nth-child(3)::before{
    content: "Year";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  #profBody tr td:nth-child(4)::before{
    content: "Registration No";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  /* Experience */
  #expBody tr td:nth-child(1)::before{
    content: "Designation";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  #expBody tr td:nth-child(2)::before{
    content: "Organization";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  #expBody tr td:nth-child(3)::before{
    content: "From";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  #expBody tr td:nth-child(4)::before{
    content: "To";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  #expBody tr td:nth-child(5)::before{
    content: "Duration";
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }

  /* remove button alignment */
  .table td .btn{
    width: 100%;
    justify-content: center;
    margin-top: 6px;
  }
}



/* =========================
   LANGUAGE SKILLS - SIMPLE MOBILE
   ========================= */
@media (max-width: 768px){

  .language-section .table-wrap{
    overflow: visible;
  }

  .language-section .table{
    width: 100%;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
  }

  .language-section .table thead{
    display: none;
  }

  .language-section .table,
  .language-section .table tbody,
  .language-section .table tr,
  .language-section .table td{
    display: block;
    width: 100%;
  }

  .language-section .table tr{
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid rgba(128,0,0,.10);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(38,0,0,.05);
  }

  .language-section .table td{
    border: 0;
    padding: 0;
    background: transparent !important;
  }

  .language-section .table td:first-child{
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
    margin-bottom: 12px;
  }

  .language-section .table td:not(:first-child){
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
    margin: 0 0 10px 0;
    padding: 10px 16px;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 10px;
    background: #fafafa !important;
    box-sizing: border-box;
  }

  .language-section .table td input[type="radio"]{
    margin: 0;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    transform: none;
  }

  .language-section .table td:nth-child(2)::before{
    content: "Excellent";
  }

  .language-section .table td:nth-child(3)::before{
    content: "Good";
  }

  .language-section .table td:nth-child(4)::before{
    content: "Average";
  }

  .language-section .table td:nth-child(5)::before{
    content: "Poor";
  }

  .language-section .table td:nth-child(6)::before{
    content: "None";
  }

  .language-section .table td:nth-child(2)::before,
  .language-section .table td:nth-child(3)::before,
  .language-section .table td:nth-child(4)::before,
  .language-section .table td:nth-child(5)::before,
  .language-section .table td:nth-child(6)::before{
    display: block;
    flex: 1;
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
    line-height: 1.4;
    padding-right: 16px;
  }
}

.field{
  display: flex;
  flex-direction: column;
  margin-top: 15px;
}

.language-section .table th,
.language-section .table td{
  text-align: center;
  vertical-align: middle;
}

.language-section .table th:first-child,
.language-section .table td:first-child{
  text-align: left;
}

.language-section .table td input[type="radio"]{
  display: block;
  margin: 0 auto;
}