/*
 * Minimal interface theme.
 *
 * This file is intentionally loaded after the feature stylesheets. It keeps
 * the existing page structure and behaviour while reducing decorative noise
 * and making the signed-in experience mobile-first.
 */
:root {
  --ink: #18211f;
  --muted: #68746f;
  --line: #dfe5e2;
  --soft: #f4f7f5;
  --card: #ffffff;
  --brand: #147a72;
  --brand-dark: #0e615a;
  --brand-soft: #edf6f4;
  --accent: #a36b20;
  --danger: #b73d3d;
  --shadow: 0 4px 16px rgba(24, 45, 40, .06);
  --radius: 14px;
}

body {
  color: var(--ink);
  background: #f5f7f6;
}

/* Flat, quiet navigation. */
.topbar {
  height: 64px;
  gap: 24px;
  border-bottom-color: var(--line);
  background: rgba(255, 255, 255, .98);
  box-shadow: none;
  backdrop-filter: none;
}
.brand { gap: 9px; }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  box-shadow: none;
  font-size: 19px;
}
.brand strong { letter-spacing: .03em; }
.topnav { gap: 2px; }
.topnav a { padding: 8px 11px; border-radius: 8px; }
.avatar { width: 32px; height: 32px; }

/* One visual level per section. */
.app-shell { padding-top: 36px; }
.page-heading { margin-bottom: 22px; }
.page-heading h1 {
  margin: 3px 0 5px;
  font-size: clamp(27px, 3vw, 36px);
  letter-spacing: -.025em;
}
.eyebrow { letter-spacing: .08em; }
.content-panel,
.admin-panel,
.metric-grid article,
.account-card,
.school-card,
.ticket-list-card,
.ticket-summary-card,
.announcement-history-card {
  border-color: var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: none;
}
.content-panel,
.admin-panel { padding: 22px; }
.metric-grid article { min-height: 124px; padding: 20px; }
.metric-grid article::after,
.announcement-card::before,
.announcement-history-card.latest::before { display: none; }
.metric-grid strong { margin: 6px 0 3px; font-size: 30px; }
.account-card { background: var(--card); }
.account-meta span {
  padding: 8px 0;
  border-bottom: 1px solid #edf0ee;
  border-radius: 0;
  background: transparent;
}

/* Buttons and fields use shape and contrast instead of glow or motion. */
.btn {
  border-radius: 9px;
  box-shadow: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover,
.plan-card:hover,
.payment-method:hover,
.ticket-list-card:hover {
  transform: none;
  box-shadow: none;
}
.btn-primary { box-shadow: none; }
input,
select,
textarea,
.ticket-form input,
.ticket-form select,
.ticket-form textarea,
.ticket-filter select {
  border-color: #ccd6d2;
  border-radius: 9px;
  background: #fff;
}
input:focus,
select:focus,
textarea:focus,
.ticket-form input:focus,
.ticket-form select:focus,
.ticket-form textarea:focus,
.ticket-filter select:focus {
  box-shadow: 0 0 0 3px rgba(20, 122, 114, .09);
}
.status-pill { border-radius: 7px; }

/* Dashboard: remove nested-card appearance. */
[data-page="dashboard"] .next-step {
  border-color: #c7ded9;
  background: #f7fbfa;
}
[data-page="dashboard"] .execution-result:empty { display: none; }
[data-page="dashboard"] .account-settings {
  padding: 0;
  border: 0;
  background: transparent;
}
[data-page="dashboard"] .account-settings > .panel-title { margin-bottom: 14px; }
[data-page="dashboard"] .quick-help { background: #fff; }
.guidance-notice {
  border-radius: 9px;
  background: #f5f9f8;
}
.next-step { background: #f7fbfa; }
.credential-editor { border-radius: 9px; }

/* Billing, notices and support should read like forms, not promotions. */
.billing-summary,
.billing-summary.active {
  border-color: var(--line);
  background: #fff;
  box-shadow: none;
}
.billing-summary-values span { border-radius: 9px; background: var(--soft); }
.plan-card,
.payment-method {
  border-width: 1px;
  border-radius: 12px;
  background: #fff;
}
.plan-card.selected,
.payment-method.selected {
  border-color: var(--brand);
  background: #f7fbfa;
  box-shadow: inset 0 0 0 1px var(--brand);
}
.plan-price b { font-size: 32px; }
.ticket-filter { border-radius: 12px; }
.ticket-list-card:hover { border-color: #a9c9c4; }
.ticket-message,
.ticket-message.admin-message {
  border-radius: 12px;
  background: #f7f9f8;
}
.ticket-message.admin-message { background: #f1f7f5; }
.announcement-dialog {
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(13, 36, 31, .16);
}
.announcement-dialog::backdrop {
  background: rgba(15, 25, 22, .46);
  backdrop-filter: none;
}
.announcement-card {
  padding: 28px;
  border-color: var(--line);
  border-radius: 16px;
  background: #fff;
}
.announcement-badge,
.announcement-empty-mark,
.ticket-empty > div {
  border-radius: 10px;
  background: var(--brand);
  box-shadow: none;
}
.announcement-content { border-radius: 10px; background: var(--soft); }
.announcement-history-card.latest { border-color: #a9cbc5; box-shadow: none; }

/* Admin controls stay dense, predictable and easy to scan. */
.admin-tabs {
  padding: 4px;
  border-radius: 10px;
  background: #fff;
}
.admin-tabs button { border-radius: 7px; }
.log-entry { border-radius: 9px; }
.mobile-records tbody tr { box-shadow: none; }

/* Authentication and the public page use the same restrained surface. */
.auth-layout {
  background: #f5f7f6;
}
.auth-card {
  padding: 30px;
  border-color: var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: none;
}
.auth-copy h1 { letter-spacing: -.025em; }
.marketing-nav { height: 68px; }
.marketing-hero { min-height: 560px; }
.marketing-hero h1 {
  font-size: clamp(40px, 5.2vw, 62px);
  letter-spacing: -.04em;
}
.pill { border: 1px solid #d8e8e4; border-radius: 8px; background: #f4f8f7; }
.product-preview {
  border-radius: 16px;
  background: #fff;
  box-shadow: none;
  transform: none;
}
.preview-stats article,
.preview-list > div,
.feature-grid article,
.security-list div { border-radius: 11px; }
.preview-stats article { background: var(--soft); }
.feature-grid i,
.feature-icon { border-radius: 9px; }
.marketing-section { padding: 66px 0; }
.security-band {
  margin-bottom: 66px;
  padding: 36px;
  border-radius: 16px;
  background: #173f3b;
}

/* Dialogs: plain bottom sheets on phones, compact cards elsewhere. */
.modal,
.mobile-more-sheet { box-shadow: none; }
.modal::backdrop { backdrop-filter: none; }
.icon-button { border-radius: 9px; }
.jwsession-result-card,
.captcha-panel {
  border-radius: 12px;
  background: #f7f9f8;
}

/* Keep the purpose-built leave and credential views visually isolated. */
body.leave-mobile-body { background: #f5f5f5; }
body.leave-certificate-body { background: #e4e4e4; }

@media (max-width: 760px) {
  :root { --mobile-nav-height: 62px; }

  body { font-size: 15px; line-height: 1.55; }
  .topbar {
    min-height: 54px;
    padding: calc(7px + env(safe-area-inset-top, 0px)) 14px 7px;
  }
  .brand-mark { width: 32px; height: 32px; border-radius: 8px; font-size: 17px; }
  .brand strong { font-size: 15px; }

  .app-shell {
    width: 100%;
    max-width: 620px;
    padding: 18px 12px 26px;
  }
  .page-heading { margin-bottom: 16px; }
  .page-heading h1 { font-size: 24px; line-height: 1.3; }
  .page-heading p { font-size: 13px; line-height: 1.6; }
  .eyebrow { font-size: 10px; }

  .content-panel,
  .admin-panel { padding: 15px; border-radius: 12px; }
  .panel-title { gap: 10px; margin-bottom: 13px; }
  .panel-title h2 { font-size: 18px; }
  .panel-title p { display: none; }

  /* Four narrow counters were difficult to scan; use a calm 2 x 2 grid. */
  [data-page="dashboard"] .metric-grid,
  .metric-grid,
  .metric-grid-four,
  .metric-grid-five,
  .metric-grid-six {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
  }
  [data-page="dashboard"] .metric-grid article,
  .metric-grid article {
    min-height: 82px;
    padding: 12px;
    border-radius: 11px;
  }
  .metric-grid strong { margin: 2px 0; font-size: 23px; }

  [data-page="dashboard"] .account-settings { padding: 0; }
  .account-card { padding: 14px; border-radius: 12px; }
  .account-head { margin-bottom: 10px; }
  .account-meta { gap: 5px 12px; margin: 9px 0 14px; }
  .account-actions { gap: 7px; }

  .btn,
  .btn-small,
  .text-button,
  .icon-button { min-height: 44px; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),
  select,
  textarea { min-height: 46px; border-radius: 9px; }

  .mobile-bottom-nav {
    padding-top: 3px;
    border-top-color: var(--line);
    box-shadow: none;
  }
  .mobile-bottom-nav a,
  .mobile-bottom-nav button {
    min-height: 54px;
    gap: 2px;
    border-radius: 8px;
    font-size: 11px;
  }
  .mobile-bottom-nav svg { width: 21px; height: 21px; }
  .mobile-bottom-nav [aria-current],
  .mobile-bottom-nav .active { background: #f0f6f4; }
  .mobile-more-sheet { padding: 18px 14px calc(18px + var(--safe-bottom)); border-radius: 16px 16px 0 0; }
  .mobile-more-links { margin: 14px 0; }
  .mobile-more-links a { min-height: 62px; padding: 12px; border-radius: 9px; background: var(--soft); }

  .modal {
    border-radius: 16px 16px 0 0;
  }
  .modal form { padding: 16px 14px calc(14px + var(--safe-bottom)); }
  .modal-head { margin-bottom: 14px; }

  .billing-summary { padding: 16px; }
  .billing-summary h2 { font-size: 20px; }
  .plan-grid { grid-template-columns: 1fr; gap: 9px; }
  .plan-card { padding: 14px; }
  .payment-method { padding: 14px; }
  .payment-method img { width: min(210px, 100%); }

  .ticket-create-panel,
  .ticket-reply-panel,
  .ticket-conversation { margin-bottom: 14px; }
  .ticket-list-card { padding: 15px; border-radius: 11px; }
  .ticket-list-side { min-width: 0; }
  .ticket-message { padding: 13px; border-radius: 10px; }
  .announcement-card { padding: 20px 16px; }
  .announcement-badge { width: 46px; height: 46px; }
  .announcement-heading { margin-top: 15px; }
  .announcement-content { margin-top: 14px; padding: 14px; }
  .announcement-history-card { padding: 17px; border-radius: 11px; }

  .auth-layout {
    justify-content: flex-start;
    padding: calc(22px + env(safe-area-inset-top, 0px)) 14px 24px;
  }
  .auth-brand { margin-bottom: 22px; }
  .auth-card { padding: 22px 18px; border-radius: 13px; }
  .auth-copy h1 { font-size: 25px; }

  .marketing-nav { height: 60px; margin: 0 14px; }
  .marketing-hero {
    margin: 0 16px;
    padding: 30px 0 38px;
    gap: 24px;
  }
  .marketing-hero h1 { margin: 12px 0 16px; font-size: 34px; line-height: 1.18; }
  .marketing-hero .hero-copy > p { font-size: 15px; }
  .hero-actions { margin: 22px 0; }
  .product-preview { padding: 15px; border-radius: 13px; }
  .preview-stats article { padding: 9px 5px; }
  .preview-list > div { padding: 11px; }
  .marketing-section { margin: 0 16px; padding: 42px 0; }
  .section-heading { margin-bottom: 20px; }
  .section-heading h2 { font-size: 28px; }
  .feature-grid article { padding: 20px; }
  .security-band { margin: 20px 16px 48px; padding: 24px 20px; border-radius: 13px; }
  .security-band h2 { font-size: 27px; }
}

@media (max-width: 380px) {
  .app-shell { padding-right: 10px; padding-left: 10px; }
  .account-meta { grid-template-columns: 1fr; }
  .account-actions { grid-template-columns: 1fr; }
  .account-actions .run-account { grid-column: auto; }
  .mobile-bottom-nav a,
  .mobile-bottom-nav button { font-size: 10px; }
}
