/* IAFA Student Portal */
:root {
  --navy: #1f3c88;
  --navy-d: #142a66;
  --orange: #f26b1d;
  --ink: #1f2a44;
  --muted: #64748b;
  --line: #dfe3ec;
  --bg: #f1f3f8;
  --card: #ffffff;
  --green: #15803d;
  --red: #c62828;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif; font-size: 15px; line-height: 1.5; }
a { color: var(--navy); }
.sp-wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* Header */
.sp-header { background: #fff; box-shadow: 0 1px 0 var(--line); position: relative; z-index: 20; }
.sp-header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 96px; }
.sp-brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.sp-brand img { width: 74px; height: 74px; object-fit: contain; }
.sp-brand-text { display: flex; flex-direction: column; }
.sp-brand-title { font-family: Georgia, "Times New Roman", serif; font-size: 26px; color: #222; letter-spacing: .02em; line-height: 1.1; }
.sp-o { color: var(--orange); }
.sp-brand-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.sp-user { display: flex; align-items: center; gap: 12px; text-align: right; }
.sp-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); }
.sp-welcome { font-weight: 700; color: var(--navy-d); }
.sp-code { font-weight: 700; color: var(--navy-d); font-size: 14px; }
.sp-userlinks { display: flex; gap: 14px; justify-content: flex-end; font-size: 14px; font-weight: 600; margin-top: 2px; }
.sp-userlinks a { text-decoration: none; }
.sp-userlinks a:hover { text-decoration: underline; }
.sp-social { display: flex; gap: 14px; font-size: 18px; }
.sp-social a { color: #222; }
.sp-burger { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; font-size: 24px; padding: 2px 10px; cursor: pointer; color: var(--navy); }

/* Menu bar */
.sp-nav { background: linear-gradient(#fafbfc, #e6e9ee); border-top: 1px solid #e3e6eb; border-bottom: 1px solid #d5d9e0; }
.sp-nav > ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; margin: 0 auto; padding-top: 0; padding-bottom: 0; }
.sp-nav li { position: relative; }
.sp-nav > ul > li > a { display: block; padding: 13px 16px; font-family: Georgia, "Times New Roman", serif; font-size: 13.5px; color: #555; text-decoration: none; letter-spacing: .03em; }
.sp-nav > ul > li > a .bi { font-size: 10px; }
.sp-nav > ul > li:hover > a, .sp-nav > ul > li.is-active > a { color: var(--navy); background: rgba(31,60,136,.07); }
.sp-sub { display: none; position: absolute; left: 0; top: 100%; min-width: 210px; list-style: none; margin: 0; padding: 4px 0; background: var(--navy-d); box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.sp-nav li.has-sub:hover > .sp-sub, .sp-nav li.has-sub:focus-within > .sp-sub { display: block; }
.sp-sub a { display: block; padding: 8px 16px; color: #fff; text-decoration: none; font-size: 13.5px; }
.sp-sub a:hover, .sp-sub a.is-active { background: rgba(255,255,255,.12); }

/* Main */
.sp-main { padding-top: 22px; padding-bottom: 40px; min-height: 60vh; }
.sp-page-title { font-size: 24px; font-weight: 700; color: var(--navy-d); margin: 0 0 16px; }
.sp-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.sp-box-title { margin: 0 0 12px; font-size: 15px; font-weight: 700; color: var(--navy); text-align: center; letter-spacing: .02em; }
.sp-box-title.sp-left { text-align: left; border-bottom: 1px dashed #c9cfdb; padding-bottom: 8px; }
.sp-muted { color: var(--muted); }
.sp-small { font-size: 13px; }
.sp-center { text-align: center; }
.sp-strong { font-weight: 700; margin: 0 0 8px; }
.sp-green { color: var(--green); }
.sp-red { color: var(--red); }
.sp-more { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 600; text-decoration: none; }

/* Buttons & forms */
.sp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 20px; border: 0; border-radius: 6px; background: #3b4596; color: #fff; font: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer; text-decoration: none; box-shadow: 0 2px 4px rgba(31,60,136,.2); }
.sp-btn:hover { background: var(--navy-d); color: #fff; }
.sp-btn-orange { background: #f7931e; }
.sp-btn-orange:hover { background: var(--orange); }
.sp-btn-light { background: #fff; color: var(--navy); border: 1px solid #c9cfdb; box-shadow: none; }
.sp-btn-light:hover { background: #f4f6fb; color: var(--navy); }
.sp-btn-block { display: flex; width: 100%; margin-top: 10px; }
input[type=text], input[type=password], input[type=email] { width: 100%; height: 42px; padding: 0 12px; border: 1px solid #cfd5e1; border-radius: 6px; font: inherit; color: var(--ink); background: #fff; }
input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(31,60,136,.14); }
input:disabled, input[readonly] { background: #f3f5f9; color: #475569; }
label { display: block; font-size: 13.5px; font-weight: 600; margin: 12px 0 5px; color: #334155; }
.sp-req { color: var(--red); }
.sp-alert { padding: 11px 14px; border-radius: 8px; margin: 0 0 14px; font-size: 14px; }
.sp-alert-error { background: #fdecec; color: #9f1d1d; border: 1px solid #f6caca; }
.sp-alert-success { background: #e9f7ee; color: #14632f; border: 1px solid #c4e8d1; }
.sp-alert-info { background: #eaf1ff; color: #1e3a8a; border: 1px solid #cdddfb; }

.sp-form-card { max-width: 720px; margin: 10px auto 20px; padding: 0 0 16px; overflow: hidden; }
.sp-form-card > .sp-box-title { background: #8fb3d9; color: #12305f; padding: 10px; margin: 0 0 16px; }
.sp-form-card > .sp-alert { margin: 0 20px 14px; }
.sp-form-table { padding: 0 20px; }
.sp-row { display: grid; grid-template-columns: 210px 1fr; align-items: center; gap: 12px; margin-bottom: 10px; }
.sp-row label { margin: 0; text-align: right; }
.sp-inline { display: flex; gap: 8px; }
.sp-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding: 8px 20px 4px; }
.sp-actions p { flex-basis: 100%; text-align: center; margin: 0 0 4px; }

/* Login */
.sp-login-grid { display: grid; grid-template-columns: 1fr 360px; gap: 18px; margin-bottom: 18px; }
.sp-banner { position: relative; overflow: hidden; border-radius: 12px; padding: 34px 32px; color: #fff; background: radial-gradient(circle at 85% 20%, rgba(242,107,29,.35), transparent 40%), linear-gradient(135deg, #142a66, #1f3c88 55%, #2e56b8); min-height: 300px; }
.sp-banner-tags { font-size: 12px; font-weight: 700; letter-spacing: .18em; opacity: .9; }
.sp-banner h2 { font-size: 32px; line-height: 1.15; margin: 14px 0 10px; font-weight: 800; }
.sp-banner p { max-width: 460px; opacity: .92; margin: 0 0 18px; }
.sp-chips { display: flex; flex-wrap: wrap; gap: 8px; max-width: 520px; }
.sp-chips span { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600; }
.sp-banner-icon { position: absolute; right: 26px; bottom: 6px; font-size: 140px; opacity: .12; }
.sp-login-card h3 { margin: 0 0 6px; color: var(--navy); font-size: 20px; }
.sp-login-card .sp-btn[type=submit] { margin-top: 16px; }
.sp-login-links { text-align: center; margin: 14px 0 8px; font-weight: 700; color: var(--navy); }
.sp-login-links a { text-decoration: none; }
.sp-login-links a:hover { text-decoration: underline; }
.sp-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.sp-feature { text-align: center; }
.sp-feature .bi { font-size: 34px; color: var(--orange); }
.sp-feature h4 { margin: 6px 0; color: var(--navy); }
.sp-feature p { margin: 0; color: var(--muted); font-size: 14px; }
.sp-list { list-style: none; margin: 0; padding: 0; }
.sp-list li { padding: 8px 0; border-bottom: 1px dashed #dde2ea; font-size: 14px; }
.sp-list li:last-child { border-bottom: 0; }
.sp-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 4px; background: #e8f0ff; color: var(--navy); margin-right: 4px; }
.sp-tag-grey { background: #eef0f4; color: #475569; }

/* Home */
.sp-home { display: grid; grid-template-columns: 250px 1fr 280px; gap: 18px; align-items: start; }
.sp-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sp-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 22px 10px 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--tone); font-weight: 800; font-size: 17px; letter-spacing: .02em; line-height: 1.15; transition: transform .15s ease, box-shadow .15s ease; text-align: center; }
.sp-tile .bi { font-size: 46px; margin-bottom: 8px; color: var(--tone); }
.sp-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16,24,40,.1); }
.sp-tone-blue { --tone: #1d6fd6; } .sp-tone-green { --tone: #158a54; } .sp-tone-navy { --tone: #1f3c88; }
.sp-tone-orange { --tone: #e8611a; } .sp-tone-purple { --tone: #6d3fc2; } .sp-tone-teal { --tone: #0f8a8a; }
.sp-tone-red { --tone: #c2410c; } .sp-tone-sky { --tone: #0e7fb5; } .sp-tone-slate { --tone: #334155; }
.sp-mini { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0 0 8px; font-size: 13.5px; }
.sp-mini dt { color: var(--muted); }
.sp-mini dd { margin: 0; font-weight: 600; }
.sp-batch { border-top: 1px dashed #dde2ea; padding: 8px 0 0; margin-top: 8px; font-size: 13.5px; }
.sp-batch strong, .sp-batch span { display: block; }
.sp-batch span { color: var(--muted); }
.sp-due { border-color: #f6c9a8; background: #fff8f2; }
.sp-due-amt { font-size: 26px; font-weight: 800; color: var(--red); margin: 0; }

/* Details & tables */
.sp-details { display: grid; grid-template-columns: 200px 1fr; gap: 0 24px; margin: 0; max-width: 820px; }
.sp-details dt, .sp-details dd { margin: 0; padding: 9px 0; border-bottom: 1px solid #f0f2f6; }
.sp-details dt { color: #475569; }
.sp-details dd { font-weight: 600; }
.sp-table-wrap { overflow-x: auto; }
.sp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sp-table th { background: #f3f5fa; color: #334155; font-weight: 700; text-align: left; padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sp-table td { padding: 10px; border-bottom: 1px solid #eef0f5; vertical-align: top; }
.sp-table tr.is-selected td { background: #fff8e6; }
.sp-empty { text-align: center; color: var(--muted); padding: 22px 10px !important; }
.sp-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.sp-pill-pass { background: #e7f6ec; color: var(--green); }
.sp-pill-fail { background: #fdecec; color: var(--red); }
.sp-pill-wait { background: #fff4e0; color: #a35a00; }
.sp-pill-none { background: #eef0f4; color: #64748b; }
.sp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.sp-stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.sp-stat span { display: block; color: var(--muted); font-size: 13px; }
.sp-stat strong { font-size: 22px; }
.sp-bar { display: inline-block; vertical-align: middle; width: 90px; height: 8px; border-radius: 99px; background: #e8ebf1; overflow: hidden; margin-right: 8px; }
.sp-bar span { display: block; height: 100%; background: var(--green); }
.sp-bar span.is-low { background: var(--orange); }
.sp-daygrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.sp-day { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.sp-day.is-p { background: #e7f6ec; color: var(--green); }
.sp-day.is-a { background: #fdecec; color: var(--red); }
.sp-progress-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.sp-progress-head .sp-box-title { border: 0; padding: 0; margin: 0 0 4px; font-size: 18px; }
.sp-progress-head p { margin: 0; }
.sp-ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--green) calc(var(--p) * 1%), #e8ebf1 0); flex: none; }
.sp-ring span { width: 64px; height: 64px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 800; color: var(--navy); }

/* Resume builder */
textarea, input[type=tel] { width: 100%; padding: 9px 12px; border: 1px solid #cfd5e1; border-radius: 6px; font: inherit; color: var(--ink); background: #fff; resize: vertical; }
textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(31,60,136,.14); }
.sp-resume-form label { margin-top: 0; }
.sp-resume-form label input, .sp-resume-form label textarea { margin-top: 5px; font-weight: 400; }
.sp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-bottom: 12px; }
.sp-check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.sp-resume-form .sp-check input { width: auto; margin: 0; }
.sp-rep-row { display: flex; gap: 10px; align-items: flex-start; padding: 12px; margin-bottom: 12px; border: 1px dashed #cfd5e1; border-radius: 8px; }
.sp-rep-fields { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 12px; }
.sp-rep-remove { border: 0; background: #fdecec; color: var(--red); width: 34px; height: 34px; border-radius: 6px; cursor: pointer; flex: none; }
.sp-resume-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.sp-cv { max-width: 800px; margin: 0 auto; padding: 44px 48px; background: #fff; border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(16,24,40,.08); color: #1f2937; font-size: 14px; }
.sp-cv-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 14px; border-bottom: 3px solid var(--navy); }
.sp-cv-head h2 { margin: 0; font-size: 28px; color: var(--navy-d); }
.sp-cv-head img { width: 96px; height: 116px; object-fit: cover; border: 1px solid var(--line); }
.sp-cv-headline { margin: 2px 0 6px; font-size: 16px; font-weight: 600; color: var(--orange); }
.sp-cv-contact { margin: 6px 0 0; color: #475569; font-size: 13px; }
.sp-cv section { margin-top: 18px; break-inside: avoid; }
.sp-cv h3 { margin: 0 0 8px; padding-bottom: 3px; border-bottom: 1px solid #d5dbe6; color: var(--navy); font-size: 14px; text-transform: uppercase; letter-spacing: .05em; }
.sp-cv p { margin: 0 0 6px; }
.sp-cv ul { margin: 0; padding-left: 18px; }
.sp-cv table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sp-cv th { background: #f1f4f9; text-align: left; padding: 6px 8px; }
.sp-cv td { padding: 6px 8px; border-bottom: 1px solid #edf0f5; vertical-align: top; }
.sp-cv-item { margin-bottom: 10px; }
.sp-cv-line span { float: right; color: #475569; font-size: 13px; }
.sp-cv ul.sp-cv-skills { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sp-cv-skills li { padding: 3px 10px; border-radius: 999px; background: #eef2fb; color: var(--navy-d); font-size: 13px; }
.sp-cv dl { display: grid; grid-template-columns: 150px 1fr; gap: 3px 12px; margin: 0; }
.sp-cv dt { color: #475569; }
.sp-cv dd { margin: 0; }
.sp-cv-sign { display: flex; justify-content: space-between; margin-top: 18px !important; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  .sp-header, .sp-footer, .sp-resume-bar, .sp-page-title, .sp-alert { display: none !important; }
  .sp-main { padding: 0; }
  .sp-wrap { max-width: none; padding: 0; }
  .sp-cv { max-width: none; padding: 0; border: 0; box-shadow: none; }
  .sp-cv th, .sp-cv-skills li { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Footer */
.sp-footer { background: #142a66; color: #cdd6ee; font-size: 13px; padding: 18px 0; }
.sp-footer .sp-wrap { display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: center; text-align: center; }
.sp-footer strong { color: #fff; }

/* Responsive */
@media (max-width: 1080px) {
  .sp-home { grid-template-columns: 1fr 1fr; }
  .sp-tiles { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 820px) {
  .sp-login-grid { grid-template-columns: 1fr; }
  .sp-three { grid-template-columns: 1fr; }
  .sp-burger { display: block; }
  .sp-user { display: none; }
  .sp-nav { display: none; }
  body.sp-nav-open .sp-user { display: flex; justify-content: center; text-align: center; padding: 10px 16px; border-top: 1px solid var(--line); }
  body.sp-nav-open .sp-header-row { flex-wrap: wrap; }
  body.sp-nav-open .sp-user { flex-basis: 100%; order: 3; }
  body.sp-nav-open .sp-userlinks { justify-content: center; }
  body.sp-nav-open .sp-nav { display: block; }
  .sp-nav > ul { flex-direction: column; }
  .sp-nav > ul > li > a { padding: 12px 4px; border-bottom: 1px solid #e3e6eb; }
  .sp-sub { display: block; position: static; box-shadow: none; background: #f4f6fb; padding: 0; }
  .sp-sub a { color: var(--navy); padding: 9px 18px; }
  .sp-home { grid-template-columns: 1fr; }
  .sp-tiles { grid-template-columns: repeat(2, 1fr); }
  .sp-brand img { width: 56px; height: 56px; }
  .sp-brand-title { font-size: 20px; }
  .sp-header-row { min-height: 76px; }
  .sp-grid2 { grid-template-columns: 1fr; }
  .sp-cv { padding: 22px 16px; }
  .sp-row { grid-template-columns: 1fr; gap: 4px; }
  .sp-row label { text-align: left; }
  .sp-details { grid-template-columns: 1fr; }
  .sp-details dt { border: 0; padding-bottom: 0; font-size: 13px; }
  .sp-table thead { display: none; }
  .sp-table, .sp-table tbody, .sp-table tr, .sp-table td { display: block; width: 100%; }
  .sp-table tr { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; padding: 4px 0; }
  .sp-table td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 6px 12px; text-align: right; }
  .sp-table td::before { content: attr(data-th); font-weight: 600; color: var(--muted); text-align: left; }
  .sp-table td.sp-empty { display: block; text-align: center; }
  .sp-table td.sp-empty::before { content: none; }
  .sp-banner h2 { font-size: 26px; }
  .sp-social { display: none; }
}
