/* =========================================================
   Support Ticket Form — custom layer over Bootstrap
   ========================================================= */
:root {
  --bs-primary: #0d9dda;
  --brand: #0d9dda;        /* Cerulean */
  --brand-700: #032d60;    /* Deep navy */
  --brand-soft: #e7f5fc;   /* light cerulean tint */
  --accent: #ffffff;       /* clean white badges */
  --brand-rgb: 13,157,218;
}

body {
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1200px 600px at 100% -10%, #d5eefb 0%, transparent 55%),
    radial-gradient(900px 500px at -10% 110%, #dde8f5 0%, transparent 50%),
    #f1f5f9;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* safety: never allow accidental horizontal scroll */
}

/* Primary color overrides for Bootstrap */
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-700); --bs-btn-hover-border-color: var(--brand-700); }

/* Submit button font style */
.btn-submit {
  font-weight: 700; font-size: .82rem; letter-spacing: 1px; text-transform: uppercase;
  border-radius: 8px; padding-top: .55rem; padding-bottom: .55rem;
  box-shadow: 0 6px 16px -6px rgba(var(--brand-rgb),.7);
  transition: transform .12s ease, box-shadow .18s ease;
}
.btn-submit:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -8px rgba(var(--brand-rgb),.85); }
.btn-submit:active { transform: translateY(0); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand); }
.text-primary { color: var(--brand) !important; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb),.22); }
.req { color: #dc2626; }

/* ---------- Brand panel ---------- */
.brand {
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-700) 100%);
  position: relative; overflow: hidden;
}
.brand::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(500px 300px at 20% 10%, rgba(255,255,255,.16), transparent 60%),
    radial-gradient(400px 300px at 90% 90%, rgba(255,255,255,.10), transparent 60%);
}
.brand__inner {
  position: sticky; top: 0; min-height: 100vh;
  display: flex; flex-direction: column; gap: 32px;
  padding: 44px 38px;
}
.brand__logo {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 8px 16px 8px 8px; border-radius: 16px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: 0 8px 24px -12px rgba(0,0,0,.45);
  transition: transform .2s ease, box-shadow .2s ease;
}
.brand__logo:hover { transform: translateY(-1px); box-shadow: 0 12px 28px -12px rgba(0,0,0,.55); }
.brand__logo-mark {
  position: relative; display: grid; place-items: center; width: 48px; height: 48px;
  color: #fff; border-radius: 13px; font-size: 1.4rem;
  background: linear-gradient(140deg, #ffffff22 0%, #ffffff05 100%), var(--brand);
  border: 1px solid rgba(255,255,255,.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 6px 14px -6px rgba(0,0,0,.5);
}
.brand__logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__logo-text small { font-size: .72rem; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: rgba(255,255,255,.8); }
.brand__logo-text strong { font-size: 1.3rem; font-weight: 800; letter-spacing: .3px; color: #fff; }
.brand h1 { font-size: 1.7rem; line-height: 1.25; }
.brand p { line-height: 1.6; }
.brand__steps { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.brand__steps li { display: flex; align-items: center; gap: 14px; }
.brand__step-num {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 12px; background: rgba(255,255,255,.14); color: #fff;
  border: 1px solid rgba(255,255,255,.28); font-size: 1.05rem;
}
.brand__steps strong { display: block; font-size: .98rem; }
.brand__steps small { color: rgba(255,255,255,.72); }

.brand__note {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  font-size: .85rem; color: rgba(255,255,255,.92);
}
.brand__note i { font-size: 1.1rem; }

/* ---------- Form panel ---------- */
.form-wrap { display: flex; justify-content: center; align-items: flex-start; padding: 32px clamp(16px, 4vw, 48px); }
.form-wrap .card { width: 100%; max-width: 780px; border-radius: 18px; overflow: hidden; }

/* ---------- Compact spacing & typography ---------- */
.card-body { padding: 1rem 1.25rem !important; }

/* ---------- Form header ---------- */
.form-head {
  padding-top: .6rem !important; padding-bottom: .6rem !important;
  background: linear-gradient(135deg, var(--brand-soft) 0%, #ffffff 70%) !important;
}
.form-head__title {
  font-size: 1.2rem; font-weight: 800; letter-spacing: .3px;
  background: linear-gradient(90deg, var(--brand-700) 0%, var(--brand) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--brand-700);
}
/* quiet counterpart to the title — sits at the far right of the form header */
.form-head__link {
  font-size: .78rem; font-weight: 600; color: var(--brand-700); white-space: nowrap;
  text-decoration: none; transition: color .15s ease;
}
.form-head__link:hover { color: var(--brand); }
.card-footer { padding-top: .65rem !important; padding-bottom: .65rem !important; }
.row.g-3 { --bs-gutter-y: .6rem; --bs-gutter-x: .75rem; }
.row.g-3.mb-2 { margin-bottom: .35rem !important; }
.mt-4 { margin-top: 1rem !important; }
.form-control, .form-select { font-size: .82rem; padding: .35rem .6rem; }
textarea.form-control { padding: .4rem .6rem; }

/* ---------- Section titles ---------- */
.section-title { display: flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 600; margin-bottom: 10px; }
.section-title__icon {
  display: grid; place-items: center; width: 26px; height: 26px;
  background: var(--brand-soft); color: var(--brand-700); border-radius: 7px; font-size: .82rem;
}
.form-label { font-size: .78rem; font-weight: 600; margin-bottom: .2rem; }
.muted-hint { color: #94a3b8; font-weight: 400; font-size: .72rem; }
.invalid-feedback { font-size: .74rem; }
.desc-counter { font-size: .68rem; }

/* ---------- Select2 (default theme) sized to match inputs ---------- */
.select2-container--default .select2-selection--single {
  height: 33px; border: 1px solid #ced4da; border-radius: var(--bs-border-radius); font-size: .82rem;
}
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 31px; padding-left: .6rem; color: #212529; }
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: #6c757d; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 31px; }
/* focus + open ring in brand color */
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb),.22);
}
/* selected/hover option in brand color — Select2 4.1 markup: results carry
   --highlighted / --selected classes, not the aria-selected attribute 4.0 used */
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background: var(--brand); color: #fff;
}
.select2-container--default .select2-results__option--selected { background: var(--brand-soft); color: var(--brand-700); }
.select2-container--default .select2-results__option { font-size: .82rem; padding: .3rem .6rem; }
.select2-dropdown { border-color: #ced4da; }
.select2-search--dropdown .select2-search__field { font-size: .82rem; }
/* option rendered as a name over its sub text (data-sub-text selects) */
.select2-results__option .opt { display: block; padding: 1px 0; line-height: 1.25; }
.select2-results__option .opt__name { display: block; }
/* inherits the row's own color so it stays legible on every state — hover and
   selected repaint the row, and the sub text follows instead of fighting it */
.select2-results__option .opt__desc {
  display: block;
  margin-top: 2px;
  font-size: .68rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: .01em;
  color: inherit;
  opacity: .66;
  /* a long description wraps and shows in full — the row grows to fit it */
  white-space: normal;
  overflow-wrap: anywhere;
}
/* invalid state */
.is-invalid + .select2-container--default .select2-selection--single { border-color: #dc2626; }

/* ---------- Requester type (segmented toggle) ---------- */
/* fills its column and flexes evenly so it never overflows at any width */
.req-type { display: flex; width: 100%; gap: 6px; }
.req-type .btn {
  flex: 1 1 0; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  padding: 0 .5rem; height: 33px; font-size: .78rem; font-weight: 600;
  border: 1px solid var(--brand) !important;
  border-radius: var(--bs-border-radius) !important; margin: 0 !important;
}
.req-type.is-invalid .btn { border-color: #dc2626 !important; }
.req-type.is-invalid ~ .req-type-feedback { display: block; }

/* ---------- Contact toggle (inline with input) ---------- */
.contact-toggle .btn { display: inline-flex; align-items: center; padding: 0 .6rem; font-size: .78rem; font-weight: 600; }
.contact-group .contact-toggle .btn:first-of-type { border-top-left-radius: var(--bs-border-radius); border-bottom-left-radius: var(--bs-border-radius); }
.contact-group .contact-toggle .btn { border-radius: 0; }
.contact-group .form-control { border-top-right-radius: var(--bs-border-radius); border-bottom-right-radius: var(--bs-border-radius); }
/* show validation message even though the input sits inside an input-group */
.contact-group:has(.is-invalid) ~ .contact-feedback { display: block; }

/* ---------- Dropzone ---------- */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 100%; padding: 12px; text-align: center; cursor: pointer; font-size: .82rem;
  border: 2px dashed #cbd5e1; border-radius: 10px; background: #fafbff; color: #475569;
  transition: border-color .18s, background .18s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone__icon { font-size: 1.25rem; color: var(--brand); }

.filelist { display: flex; flex-direction: column; gap: 8px; }
.filelist li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
.filelist li.invalid { border-color: #dc2626; background: #fff5f5; }
.filelist .fi-icon { flex: none; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-size: .7rem; font-weight: 700; color: #fff; }
.filelist .fi-icon.img { background: #0ea5e9; }
.filelist .fi-icon.pdf { background: #dc2626; }
.filelist .fi-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.filelist .fi-name { font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filelist .fi-size { font-size: .76rem; color: #94a3b8; }
.filelist li.invalid .fi-size { color: #dc2626; }
.filelist .fi-remove { flex: none; border: none; background: #f1f5f9; color: #475569; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 1rem; line-height: 1; }
.filelist .fi-remove:hover { background: #fee2e2; color: #dc2626; }

/* ---------- Success modal ---------- */
.success-check {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  font-size: 2rem; color: #fff; background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 10px 24px -8px rgba(22,163,74,.6);
}
.modal-content { border-radius: 18px; }

/* ---------- Responsive ---------- */
/* Tablet & below: brand panel stacks on top, steps flow in a grid */
@media (max-width: 991.98px) {
  .brand__inner { min-height: auto; position: static; padding: 28px 24px; gap: 22px; }
  .brand h1 { font-size: 1.5rem; }
  .brand__steps { flex-direction: row; flex-wrap: wrap; gap: 14px 24px; }
  .brand__steps li { flex: 1 1 220px; }
  .form-wrap { padding: 22px 14px 36px; }
}

/* Narrow laptop zone (992–1199): brand takes 1/3, so form columns are tight —
   drop the requester-type icons here so the labels always fit */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .req-type .btn { padding: 0 .35rem; font-size: .74rem; }
  .req-type .btn i { display: none; }
}

/* Phones: single-column steps, tighter card, full-width submit */
@media (max-width: 575.98px) {
  .brand__inner { padding: 22px 18px; gap: 18px; }
  .brand h1 { font-size: 1.3rem; }
  .brand__steps li { flex: 1 1 100%; }
  .brand__logo strong { font-size: 1.15rem; }
  .card-body { padding: .85rem 1rem !important; }
  .form-head { padding-left: 1rem !important; padding-right: 1rem !important; }
  .card-footer { padding-left: 1rem !important; padding-right: 1rem !important; }
  .btn-submit { width: 100%; }
  /* keep the Mobile/Telecom toggle + input on one readable line */
  .contact-toggle .btn { padding: 0 .45rem; font-size: .72rem; }
  /* requester type: drop icons on the smallest screens so labels stay readable */
  .req-type .btn { padding: 0 .25rem; font-size: .72rem; }
  .req-type .btn i { display: none; }
}

/* =========================================================
   Track your tickets — public status / history pages
   ========================================================= */
.track-page { max-width: 900px; }

.track-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.track-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.track-brand__mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-700) 100%);
  color: #fff; font-size: 1.05rem; box-shadow: 0 8px 20px -10px rgba(var(--brand-rgb),.9);
}
.track-brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.track-brand__text small { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: #64748b; }
.track-brand__text strong { font-size: 1.02rem; color: var(--brand-700); }
.track-topbar__cta { font-weight: 600; border-radius: 8px; }

.track-card { border-radius: 16px; }
.track-title { font-size: 1.35rem; font-weight: 800; color: var(--brand-700); }
.track-sub { font-size: .85rem; }

/* search box: a touch larger than the form controls elsewhere */
.track-search .input-group-text { background: #fff; border-right: 0; color: var(--brand); }
.track-search .form-control { font-size: .9rem; padding: .55rem .7rem; border-left: 0; }
.track-search .btn { font-weight: 600; }

.track-result-head { font-size: .85rem; color: #475569; margin: 0 0 .75rem; }

.track-ticket__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.track-ticket__no { font-weight: 800; color: var(--brand-700); letter-spacing: .5px; }
.track-pill { font-size: .7rem; font-weight: 600; padding: .3rem .6rem; }
/* "Priority: High" reads as a priority; "High" on its own does not */
.track-pill__label { font-weight: 500; opacity: .75; }
.track-pill--empty { background: #f1f5f9; color: #94a3b8; border: 1px solid #e2e8f0; }
.track-ticket__subject { font-size: 1rem; font-weight: 700; color: #0f172a; margin: .6rem 0 .2rem; }
.track-ticket__desc { font-size: .82rem; color: #64748b; margin-bottom: .9rem; }

.track-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .7rem 1rem; }
.track-meta__item { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.track-meta__item--wide { grid-column: 1 / -1; }
.track-meta__item .k { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: #94a3b8; }
.track-meta__item .v { font-size: .84rem; font-weight: 600; color: #1e293b; overflow-wrap: anywhere; }

.track-latest {
  margin-top: 1rem; padding: .6rem .8rem; border-radius: 12px;
  background: var(--brand-soft); border: 1px solid rgba(var(--brand-rgb),.22);
}
.track-latest__label { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-700); }
.track-latest__body { font-size: .82rem; color: #334155; overflow-wrap: anywhere; }

.track-back { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--brand-700); text-decoration: none; margin-bottom: .75rem; }
.track-back:hover { color: var(--brand); }
.track-section-title { display: flex; align-items: center; gap: 8px; font-size: .95rem; font-weight: 700; color: var(--brand-700); margin-bottom: 1rem; }

/* timeline: oldest at the top, newest last */
.track-tl { list-style: none; margin: 0; padding: 0; position: relative; }
.track-tl:before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: #e6edf5; }
.track-tl li { position: relative; padding: 0 0 1rem 1.7rem; }
.track-tl li:last-child { padding-bottom: 0; }
.track-tl li:before {
  content: ""; position: absolute; left: 0; top: 4px; width: 14px; height: 14px;
  border-radius: 50%; background: #fff; border: 3px solid var(--brand);
}
.track-tl li:last-child:before { border-color: var(--brand-700); }
.track-tl__note { font-size: .82rem; color: #475569; margin-top: .3rem; overflow-wrap: anywhere; }

@media (max-width: 575.98px) {
  .track-topbar__cta { font-size: .75rem; }
  .track-title { font-size: 1.15rem; }
  .track-meta { grid-template-columns: 1fr 1fr; }
  .track-search .form-control { font-size: .84rem; }
}

/* ---- track: empty-state hints ---- */
.track-hints { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .6rem; margin-top: 1rem; }
.track-hint {
  display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem;
  border: 1px dashed #d7e3ee; border-radius: 12px; background: #fbfdff;
}
.track-hint i { font-size: 1.05rem; color: var(--brand); }
.track-hint strong { display: block; font-size: .8rem; color: #1e293b; }
.track-hint small { font-size: .72rem; color: #94a3b8; }

/* ---- track: result summary ---- */
.track-summary { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .75rem; }
.track-summary__chips { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.track-chip {
  display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem;
  border: 1px solid #dbe4ee; border-radius: 999px; background: #fff;
  font-size: .72rem; font-weight: 600; color: #475569; text-decoration: none;
}
.track-chip b { font-weight: 800; }

/* clear link, tucked under the search box */
.track-clear { margin-top: .5rem; text-align: right; }
.track-clear a { font-size: .74rem; font-weight: 600; color: #94a3b8; text-decoration: none; }
.track-clear a:hover { color: var(--brand-700); }
.track-note { font-size: .74rem; color: #94a3b8; margin: -.35rem 0 .75rem; }

.track-ago { font-size: .7rem; color: #94a3b8; }

/* ---- track: detail summary strip ---- */
.track-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem;
  margin-top: 1rem; padding: .75rem .9rem; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-soft) 0%, #ffffff 75%);
  border: 1px solid rgba(var(--brand-rgb),.2);
}
.track-strip__item { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.track-strip__item .k { font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-700); opacity: .7; }
.track-strip__item .v { font-size: .86rem; font-weight: 700; color: var(--brand-700); overflow-wrap: anywhere; }

/* ---- track: attachments ---- */
.track-files { margin-top: 1rem; }
.track-files .k { display: block; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: #94a3b8; margin-bottom: .35rem; }
.track-files__list { display: flex; flex-wrap: wrap; gap: .4rem; }
.track-file {
  display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .65rem;
  border: 1px solid #dbe4ee; border-radius: 999px; background: #fff;
  font-size: .75rem; font-weight: 600; color: #475569; text-decoration: none;
}
.track-file:hover { border-color: var(--brand); color: var(--brand-700); }
