/* AASC / Court Ledger: a shared visual language for the arena, ticket and control room. */

@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --ink: #12232b;
  --blue: #0875a6;
  --blue2: #075a80;
  --lime: #d9f36a;
  --paper: #f4f5f2;
  --white: #ffffff;
  --muted: #6d7a80;
  --line: #dce2df;
  --signal: #df613c;
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "DM Sans", sans-serif;
  --success: #166534;
  --warning: #9a570f;
  --danger: #b64530;
  --radius-full: 999px;
  --radius-lg: 3px;
  --radius-md: 3px;
  --shadow-sm: 0 12px 28px rgba(8, 117, 166, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 20px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  cursor: default;
}

img {
  display: block;
  width: 100%;
  object-fit: cover;
}

a {
  text-decoration: none;
  color: inherit;
  transition:
    color 0.15s ease,
    opacity 0.15s ease;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  text-wrap: balance;
}

:where(
  a,
  button,
  input,
  select,
  textarea,
  summary,
  [role="button"]
):focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 3px;
}

:where(button, input, select, textarea) {
  font: inherit;
}
:where(button, a) {
  -webkit-tap-highlight-color: transparent;
}

:where(a[href], button, [role="button"], label[for], select, summary) {
  cursor: pointer;
}

:where(
  input:not([type="button"]):not([type="submit"]):not([type="reset"]):not(
      [type="checkbox"]
    ):not([type="radio"]),
  textarea,
  [contenteditable="true"]
) {
  cursor: text;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page {
  max-width: 1220px;
  margin: auto;
  padding: 0 30px 70px;
}

/* Shared wayfinding / arrival */
.nav {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--ink);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font: 700 15px var(--font-display);
  letter-spacing: -0.04em;
}

.mark {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: transparent;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}

.mark img,
.mark-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1.35);
  display: block;
}

.brand small {
  display: block;
  font: 500 9px var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
}

.navlinks {
  display: flex;
  gap: 30px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.navlinks a:hover,
.navlinks a.active {
  color: var(--blue);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-login {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  padding: 6px 10px;
}

.nav-login:hover {
  color: var(--blue);
}

.navcta {
  border: 1px solid var(--ink);
  padding: 10px 17px;
  border-radius: 3px;
  min-height: 44px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
}

.navcta:hover {
  background: var(--ink);
  color: #fff;
}

.navcta-active {
  background: var(--ink);
  color: #fff;
}

/* ==========================================
   BUTTONS & TYPOGRAPHIC LINKS
   ========================================== */
.primary {
  background: var(--ink);
  color: #fff;
  border-radius: 3px;
  min-height: 44px;
  padding: 11px 18px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.primary:hover:not(:disabled) {
  opacity: 0.9;
}

.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.primary b {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: 8px;
  background: var(--lime);
  color: var(--ink);
  border-radius: 2px;
  font-size: 11px;
}

.textlink {
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 3px;
  display: inline-block;
  cursor: pointer;
}

.textlink:hover {
  color: var(--blue);
  border-color: var(--blue);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 3px;
  min-height: 40px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--blue2);
}

.btn-dark {
  background: var(--ink);
  color: #fff;
}

.btn-dark:hover:not(:disabled) {
  background: #223742;
}

.btn-outline {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--ink);
}

.btn-lime {
  background: var(--lime);
  color: var(--ink);
}

.btn-lime:hover:not(:disabled) {
  filter: brightness(0.95);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 11px;
}

/* ==========================================
   BADGES & LABELS
   ========================================== */
.label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue2);
}

.kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 21px;
}

.kicker:before {
  content: "";
  width: 25px;
  height: 2px;
  background: var(--signal);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-blue {
  background: #e0f2fe;
  color: #0284c7;
}
.badge-lime {
  background: var(--lime);
  color: var(--ink);
}
.badge-success {
  background: #dcfce7;
  color: #166534;
}
.badge-warning {
  background: #fef3c7;
  color: #92400e;
}
.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}
.badge-neutral {
  background: var(--paper);
  color: var(--ink);
}

/* ==========================================
   COMMON SECTION HEADINGS
   ========================================== */
.section {
  padding-top: 100px;
}

.sectionhead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 35px;
  gap: 20px;
}

h2 {
  font-size: clamp(34px, 4.5vw, 54px);
  line-height: 0.95;
  letter-spacing: -0.07em;
  font-weight: 600;
  margin: 9px 0 0;
  color: var(--ink);
}

.sectionhead p {
  max-width: 320px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

/* Court schedule at a glance */
.quick {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr auto;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: none;
}

.q {
  padding: 19px 23px;
  border-right: 1px solid var(--line);
}

.q small {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 9px;
  color: var(--muted);
  margin-bottom: 7px;
  font-weight: 600;
}

.q strong {
  font: 600 14px var(--font-display);
  color: var(--ink);
}

.qbutton {
  margin: 10px;
  padding: 13px 20px;
  background: var(--blue);
  color: #fff;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  cursor: pointer;
}

.qbutton:hover {
  background: var(--blue2);
}

/* ==========================================
   CARDS & FORMS
   ========================================== */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-size: 13px;
  outline: none;
  border-radius: 3px;
  min-height: 44px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 94, 145, 0.16);
}

.form-help {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}

/* ==========================================
   ALERTS
   ========================================== */
.alert {
  padding: 12px 16px;
  font-size: 12px;
  border: 1px solid var(--line);
  margin-bottom: 16px;
  line-height: 1.5;
}

.alert-info {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #0284c7;
}
.alert-success {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}
.alert-warning {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}
.alert-danger {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

/* ==========================================
   MODAL DIALOG
   ========================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--white);
  border: 1px solid var(--line);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 45px rgba(18, 35, 43, 0.15);
  padding: 30px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--muted);
}

.modal-close:hover {
  color: var(--ink);
}

/* ==========================================
   TOAST NOTIFICATION
   ========================================== */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.18);
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastIn {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Ledger sign-off */
footer {
  margin-top: 110px;
  border-top: 1px solid var(--ink);
  padding-top: 40px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.footername {
  font: 600 25px var(--font-display);
  letter-spacing: -0.06em;
  color: var(--ink);
}

.footertext {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  margin-top: 6px;
}

.footerright {
  text-align: right;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

/* ==========================================
   PORTAL NAVIGATION STRIP
   ========================================== */
.portal-nav-strip {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  margin-bottom: 30px;
  padding-bottom: 12px;
}

.portal-link {
  font: 600 13px var(--font-display);
  color: var(--muted);
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.2s;
}

.portal-link.active,
.portal-link:hover {
  color: var(--blue);
}

/* ==========================================
   USER NAVBAR DROPDOWN (PRD Bab 4.G.1)
   ========================================== */
.user-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.user-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 7px 14px;
  border-radius: 3px;
  font: 600 12px var(--font-display);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s;
}

.user-dropdown-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.12);
  min-width: 210px;
  z-index: 1000;
  display: none;
  overflow: hidden;
}

.user-dropdown-menu.active {
  display: block;
}

.user-dropdown-header {
  padding: 10px 14px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  font: 700 10px var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  transition: background 0.15s;
  box-sizing: border-box;
}

.user-dropdown-item:hover {
  background: rgba(11, 94, 145, 0.08);
  color: var(--blue);
}

.user-dropdown-item.danger {
  color: var(--danger);
  border-top: 1px solid var(--line);
}

.user-dropdown-item.danger:hover {
  background: #fee2e2;
  color: #991b1b;
}

/* ==========================================
   MOBILE MEDIA QUERY
   ========================================== */
@media (max-width: 800px) {
  .page {
    padding: 0 17px 45px;
  }
  .nav {
    min-height: 70px;
    height: auto;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 0;
  }
  .navlinks {
    display: flex;
    order: 3;
    flex-basis: 100%;
    gap: 20px;
    overflow-x: auto;
  }
  .navlinks a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    white-space: nowrap;
  }
  .quick {
    grid-template-columns: 1fr 1fr;
  }
  .q:nth-child(2) {
    border-right: 0;
  }
  .qbutton {
    grid-column: 1 / -1;
    text-align: center;
    justify-content: center;
  }
  .section {
    padding-top: 75px;
  }
  .sectionhead {
    display: block;
  }
  .sectionhead p {
    margin-top: 12px;
  }
  footer {
    display: block;
    margin-top: 75px;
  }
  .footerright {
    text-align: left;
    margin-top: 20px;
  }
}

@media (max-width: 560px) {
  .nav {
    align-items: center;
  }
  .nav-actions {
    gap: 6px;
  }
  .brand {
    font-size: 13px;
  }
  .navlinks {
    border-top: 1px solid var(--line);
  }
  .q {
    padding: 15px;
  }
  .q strong {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
