/* ═══════════════════════════════════════════════════════════
   TERMS & CONDITIONS PAGE — Extended Stylesheet
   Built on SHURT HRMS design tokens (orange brand)
   ═══════════════════════════════════════════════════════════ */

/* ─── SECTION SHELL ─── */
.policy-sec {
  padding: 80px 0 100px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* Defensive: ensure .reveal elements inside policy section are always
   visible, even if main.js IntersectionObserver doesn't fire on this page.
   If JS does fire and add .visible, the transition still plays smoothly. */
.policy-sec .reveal {
  opacity: 1;
  transform: none;
}

.policy-sec::before {
  content: '';
  position: absolute;
  top: -180px;
  right: -120px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(239, 128, 25, .12), transparent 70%);
  pointer-events: none;
}

.policy-sec::after {
  content: '';
  position: absolute;
  bottom: -160px;
  left: -100px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(239, 128, 25, .08), transparent 70%);
  pointer-events: none;
}

.policy-wrap {
  max-width: 1040px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.policy-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 56px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, .05);
}

/* ─── META PILLS (header strip) ─── */
.policy-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.policy-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--orange-ll);
  color: var(--orange-d);
  border: 1px solid rgba(239, 128, 25, .16);
  padding: 7px 14px;
  border-radius: 100px;
  font-size: .76rem;
  font-weight: 700;
}

/* ─── INTRO BLOCK ─── */
.policy-intro {
  margin-top: 24px;
  padding: 24px 0 8px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.policy-intro p {
  color: var(--muted);
  line-height: 1.9;
  margin-bottom: 14px;
  font-size: .95rem;
}

.policy-intro p:last-child {
  margin-bottom: 24px;
}

/* ─── TABLE OF CONTENTS ─── */
.policy-toc {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 28px;
  margin: 28px 0 8px;
}

.policy-toc-title {
  font-family: var(--h);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.policy-toc-title::before {
  content: '';
  width: 18px;
  height: 2px;
  background: var(--orange);
  border-radius: 2px;
}

.policy-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 24px;
  counter-reset: toc;
}

.policy-toc ol li {
  counter-increment: toc;
  font-size: .88rem;
}

.policy-toc ol li a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--text2);
  text-decoration: none;
  padding: 6px 0;
  border: none;
  transition: color .2s, transform .2s;
}

.policy-toc ol li a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--h);
  font-weight: 800;
  font-size: .72rem;
  color: var(--orange);
  letter-spacing: .04em;
  flex-shrink: 0;
}

.policy-toc ol li a:hover {
  color: var(--orange);
  transform: translateX(2px);
}

/* ─── DOC CONTENT: SECTION LAYOUT ─── */
/* Override the global .section rule (padding:90px 0) inside our policy card */
.policy-card .section {
  padding: 0;
  margin-top: 56px;
  scroll-margin-top: 100px;
  position: relative;
}

.policy-card .section:first-child {
  margin-top: 40px;
}

.policy-card .section + .section {
  padding-top: 48px;
  border-top: 1px solid var(--border);
}

/* ─── SECTION NUMBER BADGE ─── */
.section-num {
  display: inline-block;
  font-family: var(--h);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--orange);
  background: var(--orange-ll);
  border: 1px solid rgba(239, 128, 25, .2);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 14px;
}

/* ─── HEADINGS INSIDE DOC ─── */
.doc-content h2 {
  font-family: var(--h);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
  margin-bottom: 18px;
  line-height: 1.25;
}

.doc-content h3 {
  font-family: var(--h);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text);
  margin: 28px 0 12px;
  letter-spacing: -.01em;
  padding-left: 14px;
  border-left: 3px solid var(--orange);
}

.doc-content h4 {
  font-family: var(--h);
  font-size: .96rem;
  font-weight: 700;
  color: var(--text2);
  margin: 22px 0 10px;
}

/* ─── BODY TEXT ─── */
.doc-content p {
  color: var(--muted);
  line-height: 1.85;
  margin-bottom: 14px;
  font-size: .935rem;
}

.doc-content strong {
  color: var(--text);
  font-weight: 700;
}

.doc-content a {
  color: var(--orange-d);
  text-decoration: none;
  border-bottom: 1px dashed rgba(239, 128, 25, .45);
  transition: color .2s, border-color .2s;
}

.doc-content a:hover {
  color: var(--orange);
  border-bottom-color: var(--orange);
  border-bottom-style: solid;
}

/* ─── LISTS ─── */
.doc-list {
  padding-left: 22px;
  margin: 12px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
}

.doc-list li {
  color: var(--muted);
  line-height: 1.75;
  font-size: .92rem;
  position: relative;
  padding-left: 6px;
}

.doc-list li::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  flex-shrink: 0;
}

/* ─── DEFINITION TABLE ─── */
.def-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 18px 0 22px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  font-size: .9rem;
}

.def-table thead {
  background: var(--bg2);
}

.def-table th {
  text-align: left;
  padding: 14px 18px;
  font-family: var(--h);
  font-weight: 800;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.def-table td {
  padding: 16px 18px;
  color: var(--muted);
  line-height: 1.7;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: .9rem;
}

.def-table tbody tr:last-child td {
  border-bottom: none;
}

.def-table tbody tr {
  transition: background .15s;
}

.def-table tbody tr:hover {
  background: var(--orange-ll);
}

.def-table td:first-child {
  width: 28%;
  min-width: 170px;
}

/* ─── TERM BADGES (inside table) ─── */
.term-badge {
  display: inline-block;
  padding: 5px 11px;
  background: var(--orange-ll);
  color: var(--orange-d);
  border: 1px solid rgba(239, 128, 25, .22);
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
  font-family: var(--b);
}

/* ─── INFOBOXES (callouts) ─── */
.infobox {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 14px;
  margin: 22px 0;
  border-left: 4px solid;
  align-items: flex-start;
}

.infobox-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  line-height: 1.3;
}

.infobox-text {
  line-height: 1.75;
  font-size: .92rem;
}

.infobox-text strong {
  font-weight: 700;
}

.infobox.blue {
  background: #eff6ff;
  border-color: #3b82f6;
}
.infobox.blue .infobox-text { color: #1e3a8a; }
.infobox.blue .infobox-text strong { color: #1e3a8a; }

.infobox.yellow {
  background: #fffbeb;
  border-color: #f59e0b;
}
.infobox.yellow .infobox-text { color: #78350f; }
.infobox.yellow .infobox-text strong { color: #78350f; }

.infobox.red {
  background: #fef2f2;
  border-color: #dc2626;
}
.infobox.red .infobox-text { color: #7f1d1d; }
.infobox.red .infobox-text strong { color: #7f1d1d; }

.infobox.orange {
  background: var(--orange-ll);
  border-color: var(--orange);
}
.infobox.orange .infobox-text { color: var(--orange-dd); }
.infobox.orange .infobox-text strong { color: var(--orange-dd); }

/* ─── HIGHLIGHTED HELPER BLOCK (existing class kept for back-compat) ─── */
.policy-highlight {
  background: linear-gradient(135deg, var(--orange-ll), #fff);
  border: 1px solid rgba(239, 128, 25, .14);
  border-radius: 18px;
  padding: 24px;
  margin-top: 28px;
}

.policy-highlight h3 {
  font-family: var(--h);
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text);
  padding-left: 0;
  border-left: none;
}

.policy-highlight p { margin: 0; }

/* ─── CONTACT CARD (final section) ─── */
.contact-card {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  background: linear-gradient(135deg, var(--orange-ll) 0%, #fff 100%);
  border: 1px solid rgba(239, 128, 25, .2);
  border-radius: 18px;
  padding: 32px;
  margin-top: 18px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

.contact-card::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(239, 128, 25, .15), transparent 70%);
  pointer-events: none;
}

.contact-card > div {
  position: relative;
  z-index: 1;
}

.contact-card h3 {
  margin: 0 0 8px;
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text);
  padding-left: 0;
  border-left: none;
}

.contact-card p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}

.contact-detail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: right;
  align-items: flex-end;
}

.contact-detail a {
  color: var(--orange-d);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.contact-detail a:hover {
  color: var(--orange);
  border-bottom: none;
}

/* ─── BACK-TO-TOP FLOATING BUTTON ─── */
.back-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  border: none;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(239, 128, 25, .4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s, transform .25s, visibility .25s, background .2s;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-top:hover {
  background: var(--orange-d);
  transform: translateY(-2px);
}

/* ─── UTILITY ─── */
.mb-4 { margin-bottom: 1.5rem; }
.mb-3 { margin-bottom: 1rem; }
.border-bottom { border-bottom: 2px solid var(--orange); padding-bottom: 14px; }

/* ═════════════════════════════════════════════
   RESPONSIVE
   ═════════════════════════════════════════════ */

@media (max-width: 900px) {
  .policy-toc ol {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 768px) {
  .policy-sec { padding: 60px 0 80px; }
  .policy-card { padding: 36px 26px; border-radius: 20px; }
  .policy-card .section { margin-top: 44px; }
  .policy-card .section + .section { padding-top: 36px; }
  .doc-content h2 { font-size: 1.32rem; }
  .doc-content h3 { font-size: 1rem; }
  .doc-content h4 { font-size: .92rem; }
  .doc-content p,
  .doc-list li,
  .policy-intro p { font-size: .9rem; }
  .def-table { font-size: .82rem; }
  .def-table th { font-size: .72rem; padding: 12px 14px; }
  .def-table td { padding: 12px 14px; font-size: .85rem; }
  .def-table td:first-child { min-width: 130px; }
  .contact-card {
    flex-direction: column;
    padding: 26px 22px;
  }
  .contact-detail {
    text-align: left;
    align-items: flex-start;
  }
  .policy-toc { padding: 20px 22px; }
  .back-top { width: 40px; height: 40px; bottom: 20px; right: 20px; }
}

@media (max-width: 480px) {
  .policy-card { padding: 28px 20px; }
  .policy-meta { gap: 8px; }
  .policy-pill {
    width: 100%;
    justify-content: center;
    font-size: .72rem;
  }
  .def-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: normal;
  }
  .def-table td:first-child { min-width: 120px; }
  .infobox {
    padding: 16px;
    gap: 10px;
  }
  .infobox-icon { font-size: 1.1rem; }
  .infobox-text { font-size: .86rem; }
  .doc-content h2 { font-size: 1.2rem; }
  .section-num {
    font-size: .62rem;
    padding: 5px 12px;
  }
  p, li, .infobox-text {text-align: justify; }
  a {text-align: left; }
  tbody td:nth-child(2) { min-width: 200px; text-align: justify;}
}