:root {
  --ink: #152f47;
  --muted: #607488;
  --line: #d8e2ea;
  --surface: #ffffff;
  --canvas: #f4f7f9;
  --brand: #168fc4;
  --brand-dark: #15344f;
  --brand-accent: #4bc0dc;
  --brand-soft: #e8f4f8;
  --danger: #b3261e;
  --shadow: 0 24px 70px rgba(21, 52, 79, 0.11);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(22, 143, 196, 0.04) 0 22%, transparent 22% 100%),
    radial-gradient(circle at 88% 3%, rgba(75, 192, 220, 0.13), transparent 29rem),
    var(--canvas);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  padding: 0 4vw;
  border-top: 4px solid var(--brand-accent);
  border-bottom: 1px solid rgba(216, 226, 234, 0.92);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}

.header-actions,
.portal-nav {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.nav-button {
  min-height: 42px;
  padding: 0.65rem 0.9rem;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 0.84rem;
  font-weight: 750;
}

.nav-button:hover,
.nav-button.active {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.nav-button.active {
  box-shadow: inset 0 -2px 0 var(--brand);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: clamp(130px, 12vw, 158px);
  height: auto;
  object-fit: contain;
}

.brand-divider {
  width: 1px;
  height: 34px;
  background: var(--line);
}

.brand-subtitle {
  color: var(--brand-dark);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-transform: uppercase;
}

main {
  padding: 5.5rem 4vw;
}

.centered-view {
  display: grid;
  min-height: calc(100vh - 178px);
  place-items: center;
}

.login-card,
.success-card {
  width: min(100%, 480px);
  padding: clamp(2rem, 5vw, 3.75rem);
  border: 1px solid rgba(219, 226, 232, 0.95);
  border-top: 4px solid var(--brand);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.success-card {
  text-align: center;
}

.eyebrow {
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.8rem;
  font-size: clamp(2rem, 4.5vw, 3.7rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  color: var(--brand-dark);
}

.login-card h1,
.success-card h1 {
  margin-top: 0.7rem;
  font-size: clamp(2rem, 5vw, 2.8rem);
}

.intro,
.portal-heading p,
.secondary {
  color: var(--muted);
  line-height: 1.65;
}

form label {
  display: grid;
  gap: 0.5rem;
  color: #344254;
  font-size: 0.86rem;
  font-weight: 700;
}

.login-card form {
  display: grid;
  gap: 1.15rem;
  margin-top: 2rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd4dc;
  border-radius: 3px;
  outline: 0;
  color: var(--ink);
  background: white;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

input,
select {
  min-height: 48px;
  padding: 0 0.9rem;
}

textarea {
  resize: vertical;
  min-height: 160px;
  padding: 0.9rem;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(22, 143, 196, 0.14);
}

[aria-invalid="true"] {
  border-color: var(--danger);
}

.button {
  min-height: 44px;
  padding: 0.72rem 1.2rem;
  border: 0;
  border-radius: 3px;
  font-weight: 800;
  transition:
    transform 120ms ease,
    background 120ms ease,
    opacity 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.6;
  transform: none;
}

.button-primary {
  color: white;
  background: linear-gradient(110deg, var(--brand-dark), var(--brand));
}

.button-primary:hover {
  background: var(--brand-dark);
}

.button-quiet {
  border: 1px solid var(--line);
  color: var(--ink);
  background: white;
}

.button-wide {
  width: 100%;
}

.portal {
  width: min(100%, 1100px);
  margin: 0 auto;
}

.portal-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 330px);
  gap: 4rem;
  align-items: end;
  margin-bottom: 3rem;
}

.portal-heading p {
  max-width: 680px;
}

.service-note {
  display: grid;
  gap: 0.4rem;
  padding: 1.1rem 1.2rem;
  border-left: 4px solid var(--brand-accent);
  color: var(--muted);
  background: var(--brand-soft);
  font-size: 0.84rem;
  line-height: 1.5;
}

.service-note strong {
  color: var(--ink);
}

.ticket-form {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: 0 18px 55px rgba(22, 39, 55, 0.06);
}

.form-section {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}

.section-number {
  padding: 2.2rem 1.1rem;
  border-right: 1px solid var(--line);
  color: var(--brand);
  background: linear-gradient(180deg, #f4f8fa, #ecf3f6);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-align: center;
}

.section-content {
  display: grid;
  gap: 1.3rem;
  padding: 2.2rem clamp(1.25rem, 5vw, 3rem);
}

.section-content h2 {
  margin-bottom: 0.4rem;
  font-size: 1.1rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.3rem;
}

.textarea-meta {
  display: flex;
  justify-content: space-between;
  min-height: 1rem;
  color: var(--muted);
}

.field-error,
.form-error {
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 650;
}

.form-error {
  margin: 1.4rem 2rem 0;
  padding: 0.9rem 1rem;
  border-radius: 3px;
  background: #fff0ef;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem clamp(1.25rem, 5vw, 3rem);
  color: var(--muted);
  font-size: 0.8rem;
}

.success-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 1.5rem;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: linear-gradient(145deg, var(--brand-dark), var(--brand));
  font-size: 1.7rem;
  font-weight: 800;
}

.ticket-reference {
  color: var(--brand);
  font-size: 1.2em;
}

.tickets-heading {
  align-items: center;
}

.tickets-heading .button {
  justify-self: end;
}

.tickets-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.search-field {
  width: min(100%, 480px);
}

.tickets-count {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.tickets-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: 0 18px 55px rgba(22, 39, 55, 0.06);
}

.tickets-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 850px;
}

.tickets-table th,
.tickets-table td {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.tickets-table th {
  color: var(--muted);
  background: #f8fafb;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tickets-table td {
  font-size: 0.85rem;
}

.tickets-table tbody tr:last-child td {
  border-bottom: 0;
}

.ticket-id {
  color: var(--brand-dark);
  font-weight: 850;
}

.ticket-subject {
  max-width: 340px;
  font-weight: 750;
}

.ticket-secondary {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge,
.priority-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 800;
}

.status-badge {
  color: #355064;
  background: #eaf0f4;
}

.priority-badge {
  color: #685216;
  background: #fbf0c8;
}

.priority-badge.priority-3 {
  color: #8b201a;
  background: #ffe4e1;
}

.priority-badge.priority-2 {
  color: #7a4612;
  background: #ffead2;
}

.tickets-state {
  padding: 3rem 1.5rem;
  border: 1px dashed #cbd4dc;
  border-radius: 5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.65);
  text-align: center;
}

@media (max-width: 760px) {
  main {
    padding: 3rem 1rem;
  }

  .site-header {
    padding: 0 1rem;
  }

  .site-header {
    align-items: flex-start;
    gap: 0.8rem;
    flex-direction: column;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
  }

  .brand-logo {
    width: 136px;
  }

  .brand-subtitle {
    font-size: 0.68rem;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .portal-nav {
    overflow-x: auto;
  }

  .portal-heading,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .portal-heading {
    gap: 1.5rem;
  }

  .form-section {
    grid-template-columns: 1fr;
  }

  .section-number {
    padding: 0.8rem 1.2rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    text-align: left;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .form-actions .button {
    width: 100%;
  }

  .tickets-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .tickets-heading .button {
    justify-self: stretch;
    width: 100%;
  }
}
