/* Visual design from the HighTech Innovators design system (colors, type, spacing, components).
   Google Fonts CDN, matching how MSAL.js is already loaded from a CDN rather than bundled —
   see index.html and ../CLAUDE.md → "Stack decisions". No dark variant: the source design
   system is a light-surface brand with no defined dark palette, so `color-scheme` is fixed
   to light rather than guessing one. */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;

  --hti-prussian-blue: #182535;
  --hti-moonstone: #4ab7c3;
  --hti-bittersweet: #f65e5e;
  --hti-bittersweet-text: #c24545; /* AA-contrast shade of Bittersweet for text on white */
  --hti-yinmn-blue: #3d536d;
  --hti-white: #ffffff;
  --hti-paper: #f6f8fa;
  --hti-line: #e3e8ee;

  --fg: var(--hti-yinmn-blue);
  --fg-strong: var(--hti-prussian-blue);
  --fg-muted: #6b7b8e;
  --border: var(--hti-line);
  --accent: var(--hti-moonstone);

  /* Secret-expiry status colors. Healthy/error reuse existing brand colors; amber has no
     equivalent in the HTI palette, so it's a plain status color, not an --hti- brand token. */
  --status-healthy: var(--hti-moonstone);
  --status-warning: #d98c00;
  --status-error: var(--hti-bittersweet-text);

  --font-sans: 'Poppins', 'Helvetica Neue', Arial, sans-serif;

  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 6px rgba(24, 37, 53, 0.08);
  --shadow-md: 0 8px 24px rgba(24, 37, 53, 0.1);

  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  margin: 0;
  padding: 0 1rem 3rem;
  max-width: 48rem;
  margin-inline: auto;
  background: var(--hti-paper);
  color: var(--fg);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 0 1rem;
}

.brand-logo {
  height: 2.625rem;
  width: auto;
  display: block;
}

.brand-sep {
  width: 1px;
  height: 2rem;
  background: var(--border);
}

.brand-title {
  display: flex;
  flex-direction: column;
}

h1 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--fg-strong);
  margin: 0;
}

.tagline {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--fg-muted);
  margin: 0;
}

h2 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--fg-strong);
  margin: 0 0 0.5rem;
}

h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 1rem 0 0.375rem;
}

h3:first-of-type {
  margin-top: 0.25rem;
}

.toolbar {
  background: var(--hti-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.25rem;
  margin-block: 1rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--fg-strong);
  flex: 1 1 12rem;
}

.filter-field input[type='search'],
.filter-field input[type='number'],
.filter-field select {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--fg-strong);
  background: var(--hti-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.7rem;
  box-sizing: border-box;
  outline: none;
  transition: border-color 200ms;
}

.filter-field input[type='search']:focus,
.filter-field input[type='number']:focus,
.filter-field select:focus {
  border-color: var(--hti-moonstone);
  box-shadow: 0 0 0 3px rgba(74, 183, 195, 0.18);
}

.expiry-custom-input {
  margin-top: 0.375rem;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--fg-strong);
  align-self: flex-end;
  padding-bottom: 0.5rem;
}

.filter-checkbox input {
  width: auto;
}

.sort-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.sort-row-label {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--fg-muted);
}

.sort-option {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--fg);
}

.sort-option input {
  width: auto;
}

.section-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--fg-strong);
  margin: 1.5rem 0 0.5rem;
  padding-bottom: 0.375rem;
  border-bottom: 2px solid var(--hti-line);
}

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

.app-card {
  background: var(--hti-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  margin-block: 1rem;
  transition: box-shadow 220ms var(--ease-standard), border-color 220ms var(--ease-standard);
}

/* Hover lift to --shadow-md + Moonstone border — the same card treatment used on
   hightechinnovators.nl's own service cards. */
.app-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--hti-moonstone);
}

.app-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.app-card li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.app-card li:last-child {
  border-bottom: 0;
}

.secret-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.health-icon {
  display: inline-flex;
  flex: none;
}

.health-icon.health-healthy {
  color: var(--status-healthy);
}

.health-icon.health-warning {
  color: var(--status-warning);
}

.health-icon.health-error {
  color: var(--status-error);
}

/* Pill buttons, matching the live hightechinnovators.nl button system. */
button {
  font: inherit;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.8125rem;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.4rem 1rem;
  cursor: pointer;
  transition: all var(--ease-standard) 220ms;
  background: var(--hti-white);
  color: var(--fg-strong);
  border: 2px solid var(--hti-prussian-blue);
}

button:hover:not(:disabled) {
  background: var(--hti-prussian-blue);
  color: var(--hti-white);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary calls to action — sign in, create a new secret, finish. */
.btn-primary {
  background: var(--hti-prussian-blue);
  color: var(--hti-white);
  border-color: var(--hti-prussian-blue);
  padding: 0.6rem 1.5rem;
  font-size: 0.875rem;
}

.btn-primary:hover:not(:disabled) {
  background: var(--hti-moonstone);
  border-color: var(--hti-moonstone);
}

/* Destructive actions (delete a secret, remove an owner) — Bittersweet, used sparingly per brand. */
.btn-danger {
  border-color: var(--hti-bittersweet);
  color: var(--hti-bittersweet-text);
}

.btn-danger:hover:not(:disabled) {
  background: var(--hti-bittersweet);
  border-color: var(--hti-bittersweet);
  color: var(--hti-white);
}

.error {
  color: var(--hti-bittersweet-text);
}

.read-only-note {
  font-style: italic;
  color: var(--fg-muted);
}

.app-id {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin: -0.5rem 0 0.75rem;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--fg-muted);
}

.icon-button:hover:not(:disabled) {
  background: var(--hti-paper);
  color: var(--accent);
}

.icon-button.copied {
  color: var(--hti-moonstone);
}

.new-secret-panel {
  background: var(--hti-paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.875rem;
  margin-top: 0.5rem;
}

.new-secret-panel input {
  width: 100%;
  font-family: ui-monospace, monospace;
  font-size: 0.875rem;
  color: var(--fg-strong);
  background: var(--hti-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-block: 0.5rem;
  padding: 0.55rem 0.7rem;
  box-sizing: border-box;
  outline: none;
  transition: border-color 200ms;
}

.new-secret-panel input:focus {
  border-color: var(--hti-moonstone);
  box-shadow: 0 0 0 3px rgba(74, 183, 195, 0.18);
}

/* The description/expiry form (Beschrijving + Vervalt) shares .new-secret-panel with the one-time secret
   reveal, but text/date/select fields need a normal (non-monospace) font and their own label. */
.new-secret-panel label {
  display: block;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--fg-strong);
  margin-top: 0.75rem;
}

.new-secret-panel label:first-child {
  margin-top: 0;
}

.new-secret-panel select,
.new-secret-panel input[type='text'],
.new-secret-panel input[type='date'] {
  display: block;
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--fg-strong);
  background: var(--hti-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 0.375rem 0 0;
  padding: 0.5rem 0.7rem;
  box-sizing: border-box;
  outline: none;
  transition: border-color 200ms;
}

.new-secret-panel select:focus,
.new-secret-panel input[type='text']:focus,
.new-secret-panel input[type='date']:focus {
  border-color: var(--hti-moonstone);
  box-shadow: 0 0 0 3px rgba(74, 183, 195, 0.18);
}

.new-secret-panel input[type='date'] {
  margin-top: 0.5rem;
}

.new-secret-panel > button {
  margin: 0.875rem 0.5rem 0 0;
}

/* In-page confirmation modal (render.ts's confirmDialog()) replacing the browser's own unstyled
   confirm(). */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 37, 53, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
  animation: dialog-fade-in 160ms var(--ease-standard);
}

@keyframes dialog-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.dialog {
  background: var(--hti-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  max-width: 26rem;
  width: 100%;
}

.dialog p {
  margin: 0 0 1.25rem;
  color: var(--fg);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
