@font-face {
  font-family: "Noto Sans";
  src: asset-url("/assets/NotoSans-Regular-1d2f3585.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: asset-url("/assets/Inter-Regular-d09d67ef.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: asset-url("/assets/Roboto-Regular-8fdaf4bb.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: asset-url("/assets/SourceSans3-Regular-03b1eb16.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Open Sans";
  src: asset-url("/assets/OpenSans-Regular-22420d45.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-sans: "Inter", "Space Grotesk", system-ui, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
}

.landing-page {
  --font-sans: "Plus Jakarta Sans", "Inter", "Space Grotesk", system-ui, sans-serif;
  --font-display: "Plus Jakarta Sans", "Space Grotesk", "Inter", system-ui, sans-serif;
}

body {
  font-family: var(--font-sans);
}

.font-display {
  font-family: var(--font-display);
}

.link-primary {
  color: var(--brand-primary, #2563eb);
  font-weight: 600;
  text-decoration: underline;
}

.visible-bullets {
  list-style: disc;
  list-style-position: outside;
  padding-left: 1.25rem;
}

.visible-bullets li::marker {
  color: #f8fafc;
}

.tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tooltip-button {
  display: inline-flex;
  height: 1.1rem;
  width: 1.1rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid #cbd5f5;
  background: #eef2ff;
  color: #1d4ed8;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}

.tooltip-content {
  position: absolute;
  left: 0;
  right: auto;
  top: 1.6rem;
  min-width: 14rem;
  max-width: 18rem;
  border-radius: 0.375rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 0.5rem 0.65rem;
  font-size: 0.7rem;
  color: #334155;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  z-index: 10;
}

.tooltip-content--left {
  left: 0;
  right: auto;
}

.tooltip:hover .tooltip-content,
.tooltip:focus-within .tooltip-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lightbox-dialog {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
}

.lightbox-dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
}

.lightbox-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 94vw;
  max-height: 94vh;
}

.lightbox-image {
  display: block;
  max-width: 94vw;
  max-height: 94vh;
  border-radius: 0.5rem;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.3);
}

.lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  height: 2.5rem;
  width: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
  padding: 0;
  cursor: pointer;
  color: #f8fafc;
  transition: transform 150ms ease, background 150ms ease;
}

.lightbox-close:hover {
  background: rgba(15, 23, 42, 0.8);
  transform: scale(1.08);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.75rem;
  width: 2.75rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
  color: #f8fafc;
  padding: 0;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease;
}

.lightbox-icon {
  display: block;
}

.lightbox-close .lightbox-icon {
  width: 1.125rem;
  height: 1.125rem;
}

.lightbox-nav .lightbox-icon {
  width: 1.5rem;
  height: 1.5rem;
}

.lightbox-nav--prev {
  left: 0.75rem;
}

.lightbox-nav--next {
  right: 0.75rem;
}

.lightbox-nav:hover {
  background: rgba(15, 23, 42, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.plan-card {
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.plan-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.plan-card--selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.4), 0 20px 55px rgba(37, 99, 235, 0.2);
}

.plan-card--dark.plan-card--selected {
  border-color: #dbeafe;
  box-shadow: 0 0 0 4px rgba(147, 197, 253, 0.85), 0 30px 80px rgba(59, 130, 246, 0.45);
}

select.rounded-md {
  height: 2.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

html {
  overflow-x: hidden;
}

body {
  background: #f8fafc;
  color: #0f172a;
}

.turbo-progress-bar,
turbo-progress-bar {
  display: none !important;
}

main {
  animation: fade-up 0.6s ease both;
}

h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  font-weight: 600;
}

label {
  color: #334155;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
select,
textarea {
  background-color: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 16px;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.12);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes notification-pulse {
  0% {
    transform: scale(0.95);
    opacity: 0.6;
  }
  70% {
    transform: scale(1.3);
    opacity: 0;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

.notification-pulse {
  animation: notification-pulse 3s ease-out infinite;
}

@keyframes admin-support-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.admin-support-pulse {
  animation: admin-support-pulse 3s ease-out infinite;
}

dialog.support-dialog {
  margin: auto;
}

.message-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.message-expanded {
  -webkit-line-clamp: unset;
}

.priority-select option[value="low"] {
  color: #16a34a;
}

.priority-select option[value="normal"] {
  color: #2563eb;
}

.priority-select option[value="high"] {
  color: #dc2626;
}

@keyframes landing-fade-in {
  from { opacity: 0; transform: scale(1.1); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes landing-slide-up {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-landing-fade-in {
  animation: landing-fade-in 1.2s ease-out;
}

.animate-landing-slide-up {
  animation: landing-slide-up 0.8s ease-out 0.3s both;
}

/* ===========================================================
   App design system (in-app pages only — landing untouched)
   =========================================================== */

body:not(.landing-page) {
  background: #f6f8fb;
}

/* Cards */
.app-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 0.875rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -12px rgba(15, 23, 42, 0.08);
}

.app-card-tight {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 0.625rem;
}

.app-card-inset {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.625rem;
}

.app-card-hover {
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.app-card-hover:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 18px 32px -16px rgba(15, 23, 42, 0.18);
  border-color: #cbd5e1;
}

/* Page header (hero strip atop in-app pages) */
.page-header {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: #ffffff;
  padding: 1.1rem 1.25rem;
}

.page-header__eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-primary, #2563eb);
}

.page-header__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: #0f172a;
}

/* Icon-tile in a page-header sits flush with the visual top of the title
   and any action buttons. Smaller, baseline-friendly size; no centering offset. */
.page-header .icon-tile {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
}

.page-header .icon-tile svg {
  width: 1rem;
  height: 1rem;
}

.page-header__subtitle {
  margin-top: 0.25rem;
  color: #475569;
  font-size: 0.825rem;
}

/* Stat cards */
.stat-card {
  position: relative;
  overflow: hidden;
  border-radius: 0.875rem;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: #ffffff;
  padding: 1rem 1.1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 6px 18px -10px rgba(15, 23, 42, 0.10);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.stat-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 16px 30px -14px rgba(15, 23, 42, 0.20);
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent, #94a3b8);
}

.stat-card--current { --accent: #2563eb; }
.stat-card--current:hover { border-color: #93c5fd; }
.stat-card--due { --accent: #f97316; }
.stat-card--due:hover { border-color: #fdba74; }
.stat-card--overdue { --accent: #e11d48; }
.stat-card--overdue:hover { border-color: #fda4af; }

.stat-card__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
}

.stat-card__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-top: 0.6rem;
  color: var(--accent, #0f172a);
}

.stat-card__caption {
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 0.5rem;
}

.stat-card__bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  margin-top: 0.75rem;
  overflow: hidden;
}

.stat-card__bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent, #94a3b8);
}

/* Icon tiles */
.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.625rem;
  flex: none;
}

.icon-tile svg { width: 1.125rem; height: 1.125rem; }

.icon-tile--blue { background: #dbeafe; color: #1d4ed8; }
.icon-tile--orange { background: #ffedd5; color: #c2410c; }
.icon-tile--rose { background: #ffe4e6; color: #be123c; }
.icon-tile--emerald { background: #d1fae5; color: #047857; }
.icon-tile--amber { background: #fef3c7; color: #b45309; }
.icon-tile--violet { background: #ede9fe; color: #6d28d9; }
.icon-tile--slate { background: #e2e8f0; color: #334155; }

.icon-tile--sm {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
}
.icon-tile--sm svg { width: 0.9375rem; height: 0.9375rem; }

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  border: 1px solid transparent;
  line-height: 1;
}

.pill::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.95;
}

.pill--current { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.pill--due { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.pill--overdue { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.pill--success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.pill--warn { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.pill--info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.pill--danger { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.pill--neutral { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }

.pill--no-dot::before { display: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  line-height: 1;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: #0f172a;
  color: #f8fafc;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 6px 14px -8px rgba(15, 23, 42, 0.7);
}

.btn-primary:hover { background: #1e293b; }

.btn-brand {
  background: var(--brand-primary, #2563eb);
  color: #ffffff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 6px 14px -8px rgba(37, 99, 235, 0.55);
}

.btn-brand:hover { filter: brightness(1.05); }

.btn-secondary {
  background: #ffffff;
  color: #334155;
  border-color: #e2e8f0;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.btn-secondary:hover { background: #f8fafc; border-color: #cbd5e1; }

.btn-ghost {
  background: transparent;
  color: #475569;
}

.btn-ghost:hover { background: rgba(148, 163, 184, 0.14); color: #0f172a; }

.btn-danger {
  background: #e11d48;
  color: #ffffff;
  box-shadow: 0 6px 14px -8px rgba(225, 29, 72, 0.55);
}

.btn-danger:hover { filter: brightness(1.05); }

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  border-radius: 0.4375rem;
}

.btn-xs {
  padding: 0.25rem 0.55rem;
  font-size: 0.6875rem;
  border-radius: 0.375rem;
  font-weight: 600;
}

/* Section title */
.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  color: #0f172a;
}

.section-title__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.25rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.6875rem;
  font-weight: 700;
}

/* Nav (logged-in only) */
.app-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.1rem;
  color: #475569;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: color 140ms ease;
}

.app-nav-link:hover { color: #0f172a; }

.app-nav-link.is-active {
  color: #2563eb;
}

.app-nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -14px;
  height: 2px;
  border-radius: 2px;
  background: #2563eb;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem 1rem;
  color: #64748b;
  font-size: 0.8125rem;
}

.empty-state__icon {
  display: inline-flex;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #94a3b8;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

/* Donut / ring (CSS only) */
.donut {
  --size: 110px;
  --thickness: 12px;
  --value: 0;
  --color: #2563eb;
  width: var(--size);
  height: var(--size);
  border-radius: 999px;
  background: conic-gradient(var(--color) calc(var(--value) * 1%), #e2e8f0 0);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: var(--thickness);
  background: #ffffff;
  border-radius: 999px;
}

.donut__label {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: #0f172a;
  letter-spacing: -0.02em;
}

/* Status bar (segmented) */
.status-bar {
  display: flex;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #e2e8f0;
}

.status-bar > span {
  display: block;
  height: 100%;
}

.status-bar > .seg-current { background: #2563eb; }
.status-bar > .seg-due { background: #f97316; }
.status-bar > .seg-overdue { background: #e11d48; }

/* Tag (small label, no dot) */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.5rem;
  border-radius: 0.375rem;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Form helpers */
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.3rem;
}

.form-help {
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 0.3rem;
}

/* Subtle divider */
.app-divider {
  height: 1px;
  background: #e2e8f0;
  border: 0;
}
