@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
  color-scheme: light;
  --bg: #f6f8fc;
  --bg-elevated: #ffffff;
  --bg-subtle: #edf2f8;
  --surface: #ffffff;
  --surface-subtle: #fbfdff;
  --border: #dfe7f3;
  --border-strong: #c4d0e2;
  --text: #0b1220;
  --text-secondary: #334155;
  --muted: #64748b;
  --brand: #1b859c;
  --brand-dark: #136275;
  --brand-hover: #0f5262;
  --brand-soft: #e3f3f7;
  --brand-glow: rgba(27, 133, 156, 0.16);
  --accent: #25b746;
  --accent-soft: #def8e5;
  --brand-yellow: #f1dd00;
  --brand-yellow-soft: #fff9b8;
  --success: #059669;
  --success-soft: #d1fae5;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --header-bg: rgba(255, 255, 255, 0.88);
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 1px rgba(255, 255, 255, 0.9) inset;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08), 0 1px 0 rgba(255, 255, 255, 0.85) inset;
  --shadow-lg: 0 28px 70px rgba(15, 23, 42, 0.14), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 15% -10%, rgba(27, 133, 156, 0.11), transparent 32%),
    radial-gradient(circle at 95% 0%, rgba(37, 183, 70, 0.08), transparent 28%),
    linear-gradient(180deg, #fbfdff 0%, var(--bg) 36%, #eef3fa 100%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--brand-hover); }

.hidden { display: none !important; }

.muted { color: var(--muted); }
.mono {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 0.875em;
  letter-spacing: -0.01em;
}

/* Alerts */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-top: 16px;
  line-height: 1.5;
}

.alert.error {
  background: var(--danger-soft);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert.success {
  background: var(--success-soft);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert.info {
  background: var(--brand-soft, #eef4ff);
  color: var(--brand-dark, #1e3a8a);
  border: 1px solid var(--brand-border, #c7d7fe);
}

/* Fields locked because they were provided by the SPFx host */
.field input.is-locked,
.field select.is-locked {
  background: var(--surface-muted, #f1f5f9);
  color: var(--text-secondary, #475569);
  cursor: not-allowed;
}

.error { color: var(--danger); margin-top: 12px; font-size: 0.9rem; }

/* Layout */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-mesh {
  background-color: transparent;
  background-image:
    radial-gradient(ellipse 80% 42% at 50% -18%, rgba(27, 133, 156, 0.16), transparent 72%),
    radial-gradient(circle at 100% 0%, rgba(37, 183, 70, 0.1), transparent 40%);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(20px, 4vw, 40px);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(226, 232, 244, 0.9);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.045), 0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.03em;
}

.site-brand:hover { color: var(--text); }

.brand-logo {
  display: block;
  height: 20px;
  width: auto;
  object-fit: contain;
  object-position: left center;
  flex-shrink: 0;
}

.brand-logo-lg {
  height: 26px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-text small {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-xs);
}

.site-nav a {
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.site-nav a:hover {
  background: var(--bg-elevated);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-xs);
}

.site-nav a.active {
  background: linear-gradient(180deg, var(--brand-yellow) 0%, #d6c500 100%);
  color: #182327;
  box-shadow: 0 4px 14px var(--brand-glow);
}

.site-main {
  flex: 1;
  padding: clamp(32px, 5vw, 56px) clamp(20px, 4vw, 40px) clamp(48px, 6vw, 72px);
}

.container { width: min(1120px, 100%); margin: 0 auto; }
.container-narrow { width: min(580px, 100%); margin: 0 auto; }

/* Cards */
.card {
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-subtle) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 36px);
  box-shadow: var(--shadow);
}

.card-elevated {
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.8);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(251, 253, 255, 0.98) 100%),
    radial-gradient(circle at 20% 0%, rgba(27, 133, 156, 0.08), transparent 36%);
}

.card-header {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.card-header h1 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 3vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.card-header h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.card-header p,
.card p.lead,
p.lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-dark);
  margin-bottom: 14px;
  padding: 6px 12px;
  background: linear-gradient(180deg, #f5fbfd 0%, var(--brand-soft) 100%);
  border: 1px solid rgba(27, 133, 156, 0.14);
  border-radius: 999px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.btn:hover {
  background: var(--bg);
  border-color: var(--border-strong);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.btn.primary {
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 24px var(--brand-glow), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

.btn.primary:hover {
  background: linear-gradient(180deg, var(--brand-hover) 0%, #0b3f4b 100%);
  color: #fff;
  box-shadow: 0 8px 24px var(--brand-glow);
}

.btn.subtle {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  box-shadow: none;
}

.btn.subtle:hover { background: var(--bg-subtle); color: var(--text); box-shadow: none; }

.btn.ghost {
  background: rgba(255, 255, 255, 0.74);
  border-color: var(--border);
}

.btn.lg { padding: 14px 28px; font-size: 0.95rem; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.btn-block { width: 100%; }

/* Forms */
.form-section { margin-bottom: 8px; }

.form-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 28px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.form-section-title:first-child { margin-top: 0; }

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.field span,
.field label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.field-hint {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font: inherit;
  font-size: 0.9375rem;
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.field input::placeholder,
.field textarea::placeholder { color: #94a3b8; }

.field input:hover,
.field select:hover,
.field textarea:hover { border-color: #94a3b8; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-glow);
  background: #fff;
}

.field textarea { resize: vertical; min-height: 88px; }

.field-required::after {
  content: ' *';
  color: var(--danger);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge.trialing { background: var(--brand-soft); color: var(--brand-dark); }
.badge.active { background: var(--success-soft); color: var(--success); }
.badge.past_due { background: var(--warning-soft); color: var(--warning); }
.badge.expired,
.badge.canceled { background: var(--danger-soft); color: var(--danger); }

.badge.yes { background: var(--success-soft); color: var(--success); }
.badge.no { background: var(--bg-subtle); color: var(--muted); }

/* Status panel */
.status-panel {
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 8px;
}

.status-panel.trialing {
  background: linear-gradient(135deg, #eef9f4 0%, var(--brand-soft) 100%);
  border: 1px solid rgba(27, 133, 156, 0.22);
}

.status-panel.active {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #a7f3d0;
}

.status-panel.past_due {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
}

.status-panel.expired {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 1px solid #fecaca;
}

.status-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.status-panel h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.status-panel > p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.status-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.metric {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  backdrop-filter: blur(4px);
}

.metric strong {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--text);
}

.metric span {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Feature grid (shared) */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(27, 133, 156, 0.22);
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--brand-soft) 0%, #dbeafe 100%);
  color: var(--brand);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid rgba(27, 133, 156, 0.12);
}

.feature-icon svg {
  width: 24px;
  height: 24px;
}

.health-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.health-pill.ok { border-color: #a7f3d0; background: #ecfdf5; color: var(--success); }
.health-pill.warn { border-color: #fde68a; background: #fffbeb; color: var(--warning); }
.health-pill.err { border-color: #fecaca; background: #fef2f2; color: var(--danger); }

.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.92); }
}

.health-pill.ok .health-dot { animation: none; }

/* Data table */
.data-table-wrap {
  overflow: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  padding: 14px 18px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover { background: #f8fafc; }

.data-table tr:last-child td { border-bottom: none; }

.data-table .method {
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.data-table .method.get { color: var(--success); }
.data-table .method.post { color: var(--brand); }

.data-table code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.8125rem;
  background: #f1f5f9;
  padding: 4px 9px;
  border-radius: 6px;
  color: var(--text);
  border: 1px solid var(--border);
}

.hint-box {
  margin-top: 24px;
  padding: 18px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.65;
  text-align: center;
}

.hint-box code {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  word-break: break-all;
}

.site-footer {
  padding: 40px clamp(20px, 4vw, 40px);
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.site-footer-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.site-footer-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
}

.site-footer-links a:hover { color: var(--brand); }

/* Chronodat-branded footer */
.site-footer-chronodat {
  border-top: none;
  background: linear-gradient(180deg, #0e2a33 0%, #0a2129 100%);
  padding: 44px clamp(20px, 4vw, 40px) 36px;
}

.site-footer-chronodat .site-footer-inner {
  width: min(720px, 100%);
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
}

.site-footer-chronodat .footer-brand {
  display: inline-flex;
  align-items: center;
}

.site-footer-chronodat .footer-logo {
  height: 19px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.site-footer-chronodat .footer-social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 4px 0 2px;
  padding: 0;
  list-style: none;
}

.site-footer-chronodat .footer-social a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  transition: background var(--transition, 0.2s ease), color var(--transition, 0.2s ease), transform var(--transition, 0.2s ease);
}

.site-footer-chronodat .footer-social a:hover {
  background: var(--brand);
  color: #fff;
  transform: translateY(-2px);
}

.site-footer-chronodat .footer-social svg {
  width: 19px;
  height: 19px;
}

.site-footer-chronodat .footer-copy {
  margin: 4px 0 0;
  color: #fff;
  font-size: 0.95rem;
}

.site-footer-chronodat .footer-copy strong { font-weight: 700; }

.site-footer-chronodat .footer-tagline {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.85rem;
}

.site-footer-chronodat .footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  margin-top: 4px;
  font-size: 0.82rem;
}

.site-footer-chronodat .footer-legal a {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
}

.site-footer-chronodat .footer-legal a:hover { color: var(--brand-yellow, #f5b301); }

.site-footer-chronodat .footer-legal span { color: rgba(255, 255, 255, 0.3); }

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  padding: 24px 0;
  font-size: 0.9rem;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 28px 0;
}

@media (max-width: 720px) {
  .site-header {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
  }
  .brand-logo { height: 18px; }
  .brand-logo-lg { height: 23px; }
  .site-nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
  }
  .site-nav a { white-space: nowrap; }
  .card { padding: 22px 18px; }
  .brand-text small { display: none; }

  /* Larger, easier touch targets */
  .btn:not(.btn-sm) { min-height: 44px; }
  .site-main {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Prevent iOS Safari auto-zoom on focus (font-size must be >= 16px) */
  input,
  select,
  textarea,
  .field input,
  .field select,
  .field textarea {
    font-size: 16px;
  }

  /* Footer stacks and centers */
  .site-footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .site-footer-links { justify-content: center; }
}


