/* ====================================================================
   Himachal Pradesh University — Student Login & Mark Sheet
   Styling modelled on hpuniv.ac.in: government-blue masthead,
   saffron/gold accents, NAAC 'A' seal.
   ==================================================================== */

:root {
  --hpu-blue: #035d1a;        /* HPU primary green */
  --hpu-blue-dark: #024112;   /* darker green: top strip / footer */
  --hpu-blue-light: #079d2d;  /* hover green */
  --hpu-gold: #fdc10c;        /* HPU gold accent */
  --hpu-saffron: #e49700;     /* amber accent */
  --ink: #222;
  --page-bg: #eef3ee;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page-bg);
  font-family: "Segoe UI", Arial, "Helvetica Neue", sans-serif;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}
a { color: var(--hpu-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Login page background ---------- */
.login-bg {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Top strip ---------- */
.topstrip { height: 6px; background: var(--hpu-blue-dark); }

/* ---------- Masthead ---------- */
.masthead { background: #fff; border-bottom: 3px solid var(--hpu-gold); }
.masthead-inner {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 14px 16px;
}
.crest { flex: 0 0 auto; }
.crest-right { margin-left: auto; }
.crest-img { display: block; width: 84px; height: 84px; object-fit: contain; }
.masthead-text { text-align: center; flex: 1; }

.name-hi {
  font-family: "Nirmala UI", "Mangal", serif;
  color: var(--hpu-blue);
  font-size: 19px;
  margin: 0 0 2px;
  font-weight: bold;
}
.masthead h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  margin: 0;
  color: var(--hpu-blue);
  letter-spacing: 0.5px;
}
.tagline { margin: 5px 0 2px; font-size: 13px; color: var(--hpu-saffron); font-weight: 600; }
.locline { margin: 0; font-size: 12.5px; color: #555; }

/* ---------- Sub-bar ---------- */
.subbar { background: var(--hpu-blue); box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.subbar-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 11px 16px;
  color: #eafbef;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ---------- Login card ---------- */
.login-main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 16px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: #fffdf8;
  border: 1px solid var(--hpu-blue);
  border-radius: 0;
  padding: 22px 28px 22px;
  box-shadow: 0 1px 0 #fff inset, 0 2px 8px rgba(0,0,0,0.12);
}
.card-title {
  margin: 0 0 4px;
  color: var(--hpu-blue);
  font-size: 17px;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: Georgia, "Times New Roman", serif;
  border-bottom: 1px solid var(--hpu-gold);
  padding-bottom: 7px;
  text-align: center;
}
.card-sub { font-size: 12.5px; font-style: italic; color: #666; margin: 9px 0 16px; text-align: center; }

.fld-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #2a2a2a;
  margin: 0 0 5px;
}
.login-card input[type="text"],
.login-card input[type="password"],
.login-card input[type="date"] {
  width: 100%;
  padding: 10px 11px;
  margin-bottom: 16px;
  border: 1px solid #b3bdd0;
  background: #fcfdff;
  font-size: 14px;
  color: #1a1a1a;
  border-radius: 2px;
}
.login-card input:focus {
  outline: none;
  border-color: var(--hpu-blue);
  box-shadow: 0 0 0 2px rgba(3,93,26,0.15);
}

/* ---------- Buttons ---------- */
.btn-primary, .btn-secondary {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 22px;
  border: 1px solid var(--hpu-blue);
  cursor: pointer;
  letter-spacing: 0.3px;
  text-decoration: none;
  display: inline-block;
  border-radius: 2px;
}
.btn-primary { background: var(--hpu-blue); color: #fff; }
.btn-primary:hover { background: var(--hpu-blue-light); text-decoration: none; }
.btn-secondary { background: #eef1f6; color: var(--hpu-blue); }
.btn-secondary:hover { background: #e0e6f0; text-decoration: none; }
.btn-block { width: 100%; font-size: 15px; font-weight: 600; }

/* ---------- Error, demo, help ---------- */
.error-msg {
  color: #8a0000;
  background: #fbeaea;
  border: 1px solid #d8a0a0;
  border-left: 4px solid #b30000;
  padding: 9px 12px;
  margin: 14px 0 0;
  font-size: 13px;
}
.error-msg:empty { display: none; }
.demo-note { font-size: 12.5px; color: var(--hpu-blue); margin: 16px 0 8px; text-align: center; }
.card-register { font-size: 13px; text-align: center; margin: 16px 0 8px; }
.card-help { font-size: 12px; color: #777; margin: 0; text-align: center; }
.ok-msg {
  color: #0a6b22;
  background: #e8f6ec;
  border: 1px solid #a8d9b6;
  border-left: 4px solid #0a6b22;
  padding: 9px 12px;
  margin: 14px 0 0;
  font-size: 13px;
}
.ok-msg:empty { display: none; }
code {
  background: #eef1f6;
  padding: 1px 5px;
  border: 1px solid #cdd5e2;
  font-family: "Courier New", monospace;
  border-radius: 2px;
}

/* ---------- Login footer ---------- */
.login-footer {
  background: var(--hpu-blue-dark);
  color: #cfe6d4;
  text-align: center;
  font-size: 12px;
  padding: 14px 16px;
}
.login-footer p { margin: 2px 0; }

/* ====================================================================
   Mark sheet page
   ==================================================================== */
.page { max-width: 920px; margin: 22px auto; }
.marksheet-page {
  background: #fff;
  border: 1px solid #cdd5e2;
  border-top: 4px solid var(--hpu-blue);
  padding: 24px 30px 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}
.marksheet { background: #fff; }
.ms-header { display: flex; align-items: center; gap: 18px; }
.ms-title { text-align: center; flex: 1; }
.ms-title h1 { font-family: Georgia, "Times New Roman", serif; font-size: 26px; margin: 0; color: var(--hpu-blue); }
.ms-title .name-hi { font-size: 16px; }
.estd { margin: 4px 0 0; font-size: 12.5px; color: #555; }
.ms-doc-title {
  font-size: 17px;
  margin: 10px 0 0;
  color: #fff;
  background: var(--hpu-blue);
  letter-spacing: 2px;
  text-transform: uppercase;
  display: inline-block;
  padding: 4px 22px;
}
.rule-double {
  border-top: 3px double var(--hpu-blue);
  border-bottom: 1px solid var(--hpu-gold);
  height: 4px;
  margin: 14px 0;
}
.ms-exam-line { text-align: center; font-style: italic; font-size: 14px; margin: 4px 0 14px; color: #444; }

.ms-particulars { width: 100%; border-collapse: collapse; margin-bottom: 14px; border: 1px solid var(--hpu-blue); }
.ms-particulars td { border: 1px solid #c2cbdc; padding: 7px 10px; font-size: 13.5px; }
.ms-particulars .pk { background: #eaf3ec; font-weight: 600; width: 18%; color: #0a433d; }
.ms-particulars .pv { width: 32%; }

.ms-marks { width: 100%; border-collapse: collapse; border: 2px solid var(--hpu-blue); margin-bottom: 14px; }
.ms-marks th { background: var(--hpu-blue); color: #fff; border: 1px solid #057a22; padding: 8px 6px; font-size: 13px; }
.ms-marks td { border: 1px solid #c2cbdc; padding: 7px 6px; text-align: center; font-size: 13.5px; }
.ms-marks td.subj, .ms-marks th.subj { text-align: left; }
.ms-marks tbody tr:nth-child(even) { background: #f2f8f3; }
.ms-marks td.fail { color: #b30000; font-weight: bold; }

.ms-summary { width: 100%; border-collapse: collapse; border: 1px solid var(--hpu-blue); margin-bottom: 16px; }
.ms-summary td { border: 1px solid #c2cbdc; padding: 8px 10px; font-size: 13.5px; }
.ms-summary .sk { background: #eaf3ec; font-weight: 600; width: 18%; color: #0a433d; }
.ms-summary .sv { width: 32%; }
.result-pass { color: #0a6b22; font-weight: bold; }
.result-fail { color: #b30000; font-weight: bold; }

.ms-legend { font-size: 12px; color: #555; margin-bottom: 20px; }
.ms-legend p { margin: 4px 0; }
.ms-note { font-style: italic; }

.ms-signatures { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 30px; padding: 0 10px 10px; }
.sig { text-align: center; font-size: 12.5px; width: 30%; }
.sig-line { border-top: 1px solid #333; margin-bottom: 4px; }
.sig p { margin: 0; }
.seal { display: flex; justify-content: center; }
.seal-stamp {
  width: 84px; height: 84px;
  border: 2px dashed var(--hpu-blue);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--hpu-blue); font-size: 13px; letter-spacing: 2px;
  transform: rotate(-12deg); opacity: 0.6;
}
.ms-actions { text-align: center; padding: 18px 0 26px; }
.ms-actions .btn-secondary { margin-left: 10px; }

/* ---------- Print ---------- */
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .marksheet-page { border: 1px solid #000; box-shadow: none; max-width: 100%; margin: 0; }
  .ms-marks th, .ms-doc-title { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ====================================================================
   Student Dashboard
   ==================================================================== */
.dash-main {
  max-width: 800px;
  margin: 0 auto 26px;
  padding: 16px 22px 22px;
  background: #fffdf8;
  border: 1px solid #b9c4b9;
  border-top: none;
}

.dash-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #cdd5e2;
  padding-bottom: 6px;
  margin-bottom: 4px;
}
.dash-portal { font-size: 11px; font-style: italic; color: #777; letter-spacing: 0.3px; }
.btn-logout {
  font-family: inherit;
  font-size: 11px;
  color: var(--hpu-blue);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 2px 4px;
}
.btn-logout:hover { color: #b30000; }

.dash-section-title {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--hpu-blue);
  font-size: 13.5px;
  font-weight: bold;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin: 16px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--hpu-gold);
}

/* ---------- Candidate particulars (official record) ---------- */
.dash-particulars {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--hpu-blue);
  font-size: 12.5px;
  background: #fff;
}
.dash-particulars td {
  border: 1px solid #c2cbdc;
  padding: 6px 10px;
  vertical-align: top;
}
.dash-particulars .pk {
  background: #eaf3ec;
  font-weight: 600;
  width: 22%;
  color: #0a433d;
  font-family: Georgia, serif;
}
.dash-particulars .pv { width: 48%; color: #1a1a1a; }
.photo-cell {
  width: 30%;
  text-align: center;
  background: #fbfbf6;
  padding: 8px !important;
}
.photo-cell img {
  width: 108px;
  height: 138px;
  object-fit: cover;
  border: 1px solid #888;
  background: #fff;
  padding: 2px;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--hpu-blue);
  font-size: 12px;
  background: #fff;
}
.dash-table th {
  background: var(--hpu-blue);
  color: #fff;
  border: 1px solid #057a22;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-align: left;
}
.dash-table td {
  border: 1px solid #c2cbdc;
  padding: 5px 8px;
  color: #333;
  vertical-align: middle;
}
.dash-table th.act, .dash-table td.act { text-align: center; width: 96px; }
.dash-table tbody tr:nth-child(even) { background: #f2f8f3; }
.dash-table tr.yr-current { background: #fffdf4; }
.dash-table td.yr { font-weight: 600; color: #1a1a1a; white-space: nowrap; }
.yr-roman {
  display: inline-block;
  min-width: 20px;
  margin-right: 6px;
  text-align: center;
  font-family: Georgia, serif;
  color: var(--hpu-blue);
  border-right: 1px solid #cdd5e2;
  padding-right: 6px;
}
.yr-current .yr-roman { color: var(--hpu-saffron); }
.yr-status { font-size: 11px; color: #0a6b22; }
.yr-current .yr-status { color: #8a5a00; font-weight: 600; }
.btn-dl {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 3px 12px;
  color: #fff;
  background: var(--hpu-blue);
  border: 1px solid #024112;
  border-radius: 2px;
  text-decoration: none;
}
.btn-dl:hover { background: var(--hpu-blue-light); text-decoration: none; }
.dl-none, .dl-pending { font-size: 11px; font-style: italic; color: #999; }

.dash-foot-note { font-size: 11px; font-style: italic; color: #777; margin: 10px 2px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
  .masthead-inner { gap: 12px; }
  /* one crest is enough on a phone — drop the duplicate */
  .crest-right { display: none; }
  .crest-img { width: 60px; height: 60px; }
  .masthead h1 { font-size: 21px; }
  .name-hi { font-size: 16px; }
  .tagline { font-size: 12px; }
  .locline { font-size: 11.5px; }
  .subbar-inner { font-size: 13px; }

  .dash-main { padding: 14px 14px 18px; }
  .login-main { padding: 24px 12px; }

  .ms-header { flex-direction: column; text-align: center; }
}

/* Stack the wide year-wise table into labelled cards on small screens */
@media (max-width: 600px) {
  .dash-table { border: none; }
  .dash-table thead { display: none; }
  .dash-table tbody, .dash-table tr, .dash-table td { display: block; width: 100%; }
  .dash-table tr {
    border: 1px solid var(--hpu-blue);
    margin-bottom: 10px;
    background: #fff;
  }
  .dash-table tbody tr:nth-child(even) { background: #fff; }
  .dash-table td {
    border: none;
    border-bottom: 1px solid #e3eae3;
    padding: 6px 10px 6px 42%;
    position: relative;
    text-align: right;
    font-size: 12px;
  }
  .dash-table td:last-child { border-bottom: none; }
  .dash-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 10px;
    top: 6px;
    width: 38%;
    text-align: left;
    font-weight: 600;
    color: var(--hpu-blue);
  }
  /* the year cell becomes the card header bar */
  .dash-table td.yr {
    padding: 7px 10px;
    text-align: left;
    background: var(--hpu-blue);
    color: #fff;
    font-size: 13px;
    border-bottom: none;
  }
  .dash-table td.yr::before { content: none; }
  .yr-roman { color: #fff; border-right-color: rgba(255,255,255,0.5); }
  .dash-table td.act { text-align: left; padding-left: 42%; width: 100%; }
}

/* Particulars table: keep it tidy and on-screen on phones */
@media (max-width: 560px) {
  .dash-particulars { font-size: 11.5px; }
  .dash-particulars td { padding: 5px 7px; }
  .dash-particulars .pk { width: 30%; }
  .photo-cell { padding: 5px !important; }
  .photo-cell img { width: 66px; height: 84px; }
  .ms-marks { font-size: 12px; }
}
