﻿/* JPCOC design tokens — see jpcoc-design-reference.md */

:root {
  --font-ui: "Public Sans", "Source Sans Pro", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Merriweather", Georgia, Cambria, "Times New Roman", serif;

  --jpcc-navy: #0a314d;
  --jpcc-navy-dark: #062135;
  --jpcc-gold: #c1a783;
  --jpcc-gold-deep: #9c7f54;
  --jpcc-red: #760b1d;
  --jpcc-red-dark: #5d0816;

  --jpcc-bg: #f4f7fa;
  --jpcc-bg-soft: #f8fafc;
  --jpcc-surface: #ffffff;

  --jpcc-border: #d7dee6;
  --jpcc-border-strong: #b7c4d0;

  --jpcc-text: #152536;
  --jpcc-muted: #5d6b78;
  --pale-gold-bg: #f6efe3;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--jpcc-bg);
  color: var(--jpcc-text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: var(--jpcc-navy);
  text-decoration: underline;
}

a:hover,
a:focus {
  color: var(--jpcc-red);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--jpcc-gold-deep);
  outline-offset: 2px;
}

.jpcc-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Masthead */
.app-header {
  background: var(--jpcc-navy);
  border-bottom: 3px solid var(--jpcc-gold);
}

.app-header-inner {
  align-items: center;
  display: flex;
  gap: 14px;
  margin: 0 auto;
  max-width: 1180px;
  min-height: 92px;
  padding: 8px 1.375rem;
}

.app-header-seal {
  align-items: center;
  display: flex;
  flex: 0 0 88px;
  height: 88px;
  justify-content: center;
  width: 88px;
}

.app-header-seal img {
  display: block;
  height: 88px;
  object-fit: contain;
  width: 88px;
}

.app-header-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-header-title {
  color: #fff;
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 500;
  line-height: 1.08;
  margin: 0;
}

.app-header-subtitle,
.app-header-system {
  color: var(--jpcc-gold);
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.28;
  margin: 4px 0 0;
}

/* Main content */
.app-main {
  flex: 1 0 auto;
  padding: 1rem 1.375rem 1.625rem;
}

.content-container {
  margin: 0 auto;
  max-width: 1180px;
}

.content-panel {
  background: var(--jpcc-surface);
  border: 1px solid var(--jpcc-border);
  border-radius: 6px;
  margin-bottom: 1rem;
  padding: 1.25rem 1.375rem;
}

.content-panel + .content-panel {
  margin-top: 1rem;
}

.page-heading {
  border-bottom: 1px solid var(--jpcc-border);
  color: var(--jpcc-navy-dark);
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 1rem;
  padding-bottom: 0.65rem;
}

.section-heading {
  color: var(--jpcc-navy);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.25rem 0 0.75rem;
}

.page-heading + .section-heading {
  margin-top: 0;
}

.intro-text {
  color: var(--jpcc-text);
  margin: 0 0 0.85rem;
}

.intro-text:last-child {
  margin-bottom: 0;
}

.intro-text--emphasis {
  font-weight: 700;
}

.muted-note {
  color: var(--jpcc-muted);
  font-size: 0.875rem;
}

.required-marker {
  color: var(--jpcc-red);
}

.required-note {
  color: var(--jpcc-muted);
  font-size: 0.82rem;
  margin-top: 0.75rem;
}

.alert-message {
  background: #fff5f5;
  border: 1px solid #e8c4c4;
  border-left: 4px solid var(--jpcc-red);
  border-radius: 6px;
  color: var(--jpcc-text);
  margin-top: 1rem;
  padding: 0.85rem 1rem;
}

.alert-message strong {
  color: var(--jpcc-red);
}

.alert-message ul {
  margin: 0.5rem 0 0.75rem 1.25rem;
  padding: 0;
}

/* Forms */
.form-grid {
  display: grid;
  gap: 0.85rem 1rem;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.form-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.form-field.col-12 { grid-column: span 12; }
.form-field.col-6 { grid-column: span 6; }
.form-field.col-4 { grid-column: span 4; }
.form-field.col-3 { grid-column: span 3; }
.form-field.col-2 { grid-column: span 2; }

.form-label,
label.form-label {
  color: var(--jpcc-navy);
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.form-input,
.form-select,
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
select,
textarea {
  background: #fff;
  border: 1px solid var(--jpcc-border-strong);
  border-radius: 4px;
  color: var(--jpcc-text);
  direction: ltr;
  font-size: 0.9375rem;
  min-height: 38px;
  padding: 0.5rem 0.625rem;
  text-align: left;
  width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  border-color: var(--jpcc-navy);
  box-shadow: 0 0 0 2px rgba(10, 49, 77, 0.15);
  outline: none;
}

.form-actions {
  border-top: 1px solid var(--jpcc-border);
  margin-top: 1.25rem;
  padding-top: 1rem;
  text-align: center;
}

.form-checkbox-row {
  align-items: flex-start;
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.form-checkbox-row input[type="checkbox"] {
  flex: 0 0 auto;
  margin-top: 0.2rem;
}

.inline-field-group {
  align-items: end;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
}

/* Login form */
.login-form {
  margin-top: 0.85rem;
}

.sign-in-box {
  background: var(--jpcc-bg-soft);
  border: 1px solid var(--jpcc-border);
  border-left: 4px solid var(--jpcc-gold);
  border-radius: 6px;
  max-width: 42rem;
  padding: 1rem 1.125rem;
}

.login-fields {
  align-items: end;
  display: grid;
  gap: 0.75rem 0.875rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.login-field .form-label {
  margin-bottom: 0;
}

.login-form .form-input {
  min-height: 42px;
}

.login-submit {
  min-height: 42px;
  min-width: 6.75rem;
  padding-inline: 1.125rem;
  white-space: nowrap;
}

/* Buttons */
.btn-primary,
input[type="submit"].btn-primary,
input[type="button"].btn-primary,
button.btn-primary {
  background: var(--jpcc-red);
  border: 1px solid var(--jpcc-red);
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  min-height: 36px;
  padding: 0.5rem 1rem;
}

.btn-primary:hover,
.btn-primary:focus,
input[type="submit"].btn-primary:hover,
input[type="button"].btn-primary:hover,
button.btn-primary:hover {
  background: var(--jpcc-red-dark);
  border-color: var(--jpcc-red-dark);
  color: #fff;
}

.btn-secondary,
input[type="button"].btn-secondary {
  background: #fff;
  border: 1px solid var(--jpcc-border-strong);
  border-radius: 4px;
  color: var(--jpcc-navy);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  min-height: 36px;
  padding: 0.5rem 1rem;
}

.btn-secondary:hover,
.btn-secondary:focus,
input[type="button"].btn-secondary:hover {
  background: var(--jpcc-bg-soft);
  border-color: var(--jpcc-navy);
  color: var(--jpcc-navy);
}

a.btn-primary,
a.btn-secondary {
  display: inline-block;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

a.btn-primary:hover,
a.btn-primary:focus,
a.btn-secondary:hover,
a.btn-secondary:focus {
  text-decoration: none;
}

/* Tables */
.jpcc-table {
  border-collapse: collapse;
  margin: 0 0 1rem;
  width: 100%;
}

.jpcc-table th,
.jpcc-table td {
  border-bottom: 1px solid var(--jpcc-border);
  padding: 0.55rem 0.65rem;
  vertical-align: top;
}

.jpcc-table thead th,
.jpcc-table tr.table-section th {
  background: var(--jpcc-bg-soft);
  color: var(--jpcc-navy);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
}

.jpcc-table tbody tr:nth-child(even) {
  background: var(--jpcc-bg-soft);
}

.jpcc-table .table-info td {
  background: rgba(10, 49, 77, 0.06);
}

.jpcc-table .table-primary td {
  background: rgba(10, 49, 77, 0.1);
  color: var(--jpcc-navy);
  font-weight: 600;
}

.table-scroll {
  overflow-x: auto;
}

.date-list-table td:first-child {
  white-space: nowrap;
  width: 1%;
}

/* Juror dashboard */
.dashboard-service-date {
  color: var(--jpcc-text);
  margin: -0.35rem 0 1rem;
}

.record-grid {
  display: grid;
  gap: 0.65rem 1rem;
  grid-template-columns: minmax(8rem, 10rem) 1fr;
  margin: 0;
}

.record-grid dt {
  color: var(--jpcc-navy);
  font-size: 0.82rem;
  font-weight: 700;
  margin: 0;
}

.record-grid dd {
  color: var(--jpcc-text);
  margin: 0;
}

.status-block .section-heading {
  margin: 0 0 0.5rem;
  padding: 0;
}

.status-block .intro-text {
  margin: 0;
}

.status-block .intro-text:last-child {
  margin-bottom: 0;
}

.content-panel > .status-block {
  border: 1px solid var(--jpcc-border);
  border-radius: 6px;
  margin-top: 0;
  padding: 1rem 1.125rem;
}

.content-panel.status-block {
  padding: 1.25rem 1.375rem;
}

.content-panel.status-block .section-heading {
  margin-top: 0;
}

.status-block--eligible {
  background: var(--jpcc-bg-soft);
  border-left: 4px solid var(--jpcc-gold);
}

.status-block--ineligible {
  background: #fff5f5;
  border-left: 4px solid var(--jpcc-red);
}

.status-block--rescheduled {
  background: #f8fafc;
  border-left: 4px solid var(--jpcc-muted);
}

.dashboard-history .muted-note {
  margin-bottom: 0.85rem;
}

.date-action-row td {
  vertical-align: middle;
}

.date-select-btn {
  min-width: 12rem;
  white-space: normal;
}

.confirm-summary-grid {
  margin: 0;
}

.date-change-box {
  background: var(--jpcc-bg-soft);
  border: 1px solid var(--jpcc-border);
  border-left: 4px solid var(--jpcc-gold);
  border-radius: 6px;
  margin-top: 0.85rem;
  padding: 1rem 1.125rem;
}

.date-change-box .intro-text {
  margin-bottom: 0;
  margin-top: 0.85rem;
}

.date-change-grid dd {
  font-weight: 600;
}

.notice-block {
  background: #fff5f5;
  border: 1px solid #e8c4c4;
  border-left: 4px solid var(--jpcc-red);
  border-radius: 6px;
}

.notice-block .intro-text {
  margin: 0;
}

.notice-block .intro-text--emphasis {
  color: var(--jpcc-red-dark);
  margin: 0;
}

.notice-block .notice-label {
  color: var(--jpcc-red);
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.next-steps-list {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.next-steps-list li {
  margin-bottom: 0.45rem;
}

.next-steps-list li:last-child {
  margin-bottom: 0;
}

textarea.form-input {
  min-height: 6.5rem;
  resize: vertical;
}

/* Footer */
.site-footer {
  background: var(--jpcc-navy-dark);
  border-top: 3px solid var(--jpcc-gold);
  color: rgba(255, 255, 255, 0.72);
  flex: 0 0 auto;
  font-size: 0.82rem;
  line-height: 1.4;
  padding: 1rem 1.375rem;
  text-align: center;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.9);
}

.site-footer a:hover,
.site-footer a:focus {
  color: #fff;
}

/* jQuery UI datepicker hint (jexample.js) */
.example {
  color: var(--jpcc-muted);
}

.not_example {
  color: var(--jpcc-text);
}

/* Responsive */
@media (max-width: 768px) {
  .app-header-inner {
    min-height: 72px;
    padding: 8px 1rem;
  }

  .app-header-seal,
  .app-header-seal img {
    flex-basis: 64px;
    height: 64px;
    width: 64px;
  }

  .app-header-title {
    font-size: 1.35rem;
  }

  .app-header-subtitle,
  .app-header-system {
    font-size: 0.95rem;
  }

  .app-main {
    padding: 0.85rem 1rem 1.25rem;
  }

  .content-panel {
    padding: 1rem;
  }

  .form-field.col-6,
  .form-field.col-4,
  .form-field.col-3,
  .form-field.col-2 {
    grid-column: span 12;
  }

  .login-fields,
  .inline-field-group {
    grid-template-columns: 1fr;
  }

  .login-submit {
    width: 100%;
  }

  .record-grid {
    grid-template-columns: 1fr;
  }
}
