/* labelprinter.fit — design system
 * Editorial-utility aesthetic: präzise, ruhig, typografisch charaktervoll.
 * 3 Schrift-Tiers (display/body/meta), 3 Höhen-Tiers, 1 Akzent. */

@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600;700&display=swap');

:root {
  /* type — eine sans, drei tiers reichen */
  --font-display: 'Inter Tight', system-ui, -apple-system, sans-serif;
  --font-body:    'Inter Tight', system-ui, -apple-system, sans-serif;

  --t-display: 1.5rem;     /* 24px */
  --t-body:    0.9375rem;  /* 15px */
  --t-meta:    0.8125rem;  /* 13px */

  /* sizes */
  --h-elem:    40px;       /* buttons, tags, inputs, chips */
  --h-cta:     48px;       /* primary action buttons */

  /* colors */
  --ink:        hsl(220, 15%, 12%);
  --ink-soft:   hsl(220, 10%, 35%);
  --ink-faint:  hsl(220,  8%, 55%);
  --paper:      #fff;
  --bg:         hsl(40, 18%, 95%);
  --bg-inset:   hsl(40, 14%, 97%);
  --border:     hsl(40, 12%, 87%);
  --border-soft:hsl(40, 12%, 92%);

  --accent:        hsl(174, 65%, 38%);
  --accent-soft:   hsl(174, 55%, 95%);
  --accent-strong: hsl(174, 70%, 32%);

  --status-info:    hsl(212, 70%, 48%);
  --status-info-bg: hsl(212, 80%, 96%);
  --status-success: hsl(155, 55%, 36%);
  --status-success-bg: hsl(155, 50%, 95%);
  --status-warn:    hsl(38, 80%, 42%);
  --status-warn-bg: hsl(38, 85%, 95%);
  --status-danger:    hsl(0, 65%, 50%);
  --status-danger-bg: hsl(0, 75%, 96%);

  /* radii & shadow */
  --r-card: 12px;
  --r-elem: 8px;
  --r-tag:  6px;
  --shadow-card:
    0 1px 2px rgba(20, 25, 35, .04),
    0 8px 24px -8px rgba(20, 25, 35, .08);
  --shadow-modal:
    0 4px 12px rgba(20, 25, 35, .08),
    0 24px 64px -12px rgba(20, 25, 35, .18);
}

/* ── base ─────────────────────────────────────────────────────── */
html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-body);
  font-feature-settings: "cv02", "cv11", "ss01"; /* schöne Inter-Tight-Glyphen */
  -webkit-font-smoothing: antialiased;
}
body { margin: 0; padding: 24px 0; min-height: 100vh; box-sizing: border-box; }

/* Bulma normalisierungen für unser system */
.button, .input, .select select, .tag, .checkbox {
  font-family: var(--font-body);
  font-size: var(--t-body);
}

/* ── app card ─────────────────────────────────────────────────── */
.app-card {
  max-width: 720px;
  margin: 0 auto;
  background: var(--paper);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-soft);
}

.brand {
  font-weight: 600;
  font-size: 1.125rem;     /* 18px — body+2pt, klar als brand erkennbar */
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1;
}
.brand .brand-tld {
  font-weight: 400;
  color: var(--accent);
}

.app-body { padding: 22px 20px; }

.app-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-inset);
  text-align: center;
  font-size: var(--t-meta);
  color: var(--ink-faint);
}
.app-footer p { margin: 0; color: inherit; }
.app-footer p + p { margin-top: 4px; }
.app-footer strong { color: var(--ink-soft); font-weight: 600; }
.app-footer a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }
.app-footer a:hover { color: var(--accent-strong); }

/* ── chips & buttons (h = 40px) ───────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--h-elem);
  padding: 0 14px;
  border-radius: var(--r-elem);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: var(--t-body);
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.chip:hover { background: var(--bg); border-color: var(--ink-faint); }
.chip .chip-icon { font-size: 1rem; opacity: .8; }

/* Override Bulma-button-defaults im app-scope für konsistenz */
.app-card .button {
  height: var(--h-elem);
  padding: 0 16px;
  border-radius: var(--r-elem);
  border: 1px solid var(--border);
  font-weight: 500;
  background: var(--paper);
  color: var(--ink);
}
.app-card .button.is-light {
  background: var(--bg-inset);
  border-color: var(--border);
}
.app-card .button.is-light:hover {
  background: var(--bg);
  border-color: var(--ink-faint);
}
.app-card .button.is-text {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0 4px;
  height: auto;
}

/* CTA-tier */
.app-card .button.is-cta-primary,
.app-card .button.is-cta-secondary {
  height: var(--h-cta);
  font-size: var(--t-body);
  font-weight: 600;
}
.app-card .button.is-cta-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.app-card .button.is-cta-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}
.app-card .button.is-cta-secondary {
  background: var(--paper);
  border-color: var(--border);
}
.app-card .button.is-cta-secondary:hover {
  background: var(--bg-inset);
  border-color: var(--ink-faint);
}

/* segmented-controls in tweaks: buttons has-addons */
.app-card .buttons.has-addons .button {
  height: var(--h-elem);
  border-radius: 0;
  margin: 0;
}
.app-card .buttons.has-addons .button:first-child { border-top-left-radius: var(--r-elem); border-bottom-left-radius: var(--r-elem); }
.app-card .buttons.has-addons .button:last-child  { border-top-right-radius: var(--r-elem); border-bottom-right-radius: var(--r-elem); }
.app-card .buttons.has-addons .button.is-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  z-index: 1;
}

/* mini-static-addon im crop-input (L/T/R/B/B/H) */
.app-card .button.is-static {
  height: var(--h-elem);
  background: var(--bg-inset);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: var(--t-meta);
  border-color: var(--border);
}

/* ── status-tag (h = 40px, gleich wie buttons) ───────────────── */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--h-elem);
  padding: 0 14px;
  border-radius: var(--r-elem);
  font-size: var(--t-body);
  font-weight: 500;
  border: 1px solid transparent;
}
.status-tag .status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.status-tag.is-info    { background: var(--status-info-bg);    color: var(--status-info);    border-color: hsl(212, 60%, 88%); }
.status-tag.is-info .status-dot { background: var(--status-info); }
.status-tag.is-success { background: var(--status-success-bg); color: var(--status-success); border-color: hsl(155, 45%, 84%); }
.status-tag.is-success .status-dot { background: var(--status-success); }
.status-tag.is-warning { background: var(--status-warn-bg);    color: var(--status-warn);    border-color: hsl(38, 70%, 82%); }
.status-tag.is-warning .status-dot { background: var(--status-warn); }
.status-tag.is-danger  { background: var(--status-danger-bg);  color: var(--status-danger);  border-color: hsl(0, 60%, 88%); }
.status-tag.is-danger .status-dot  { background: var(--status-danger); }

/* ── inputs & select (h = 40px) ───────────────────────────────── */
.app-card .input,
.app-card .select select {
  height: var(--h-elem);
  border-radius: var(--r-elem);
  border-color: var(--border);
  font-size: var(--t-body);
}
.app-card .input:focus,
.app-card .select select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.app-card .field.has-addons .control:not(:first-child) .input {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.app-card .field.has-addons .control:not(:last-child) .button {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

/* labels in tweaks */
.app-card .field .label {
  font-size: var(--t-meta);
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* checkbox */
.app-card .checkbox { font-size: var(--t-body); }
.app-card .checkbox input { margin-right: 6px; }

/* ── drop-zone ───────────────────────────────────────────────── */
.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  border: 2px dashed var(--border);
  border-radius: var(--r-elem);
  background: var(--bg-inset);
  text-align: center;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.drop-zone:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.drop-zone.is-dragover {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.drop-zone .drop-icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 12px;
  color: var(--ink-faint);
}
.drop-zone .drop-title {
  font-weight: 600;
  font-size: var(--t-display);
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 6px;
}
.drop-zone .drop-subtitle {
  color: var(--ink-soft);
  margin: 0 0 10px;
}
.drop-zone .drop-meta {
  font-size: var(--t-meta);
  color: var(--ink-faint);
  margin: 0;
}

/* ── result section ──────────────────────────────────────────── */
.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

/* roll-preview keeps its existing structure, just refine border */
.roll-frame {
  border: 1px solid var(--border);
  border-radius: var(--r-elem);
  overflow: hidden;
  background: var(--paper);
}
.roll-frame .roll-caption {
  text-align: center;
  font-size: var(--t-meta);
  color: var(--ink-soft);
  padding: 10px 14px;
  margin: 0;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-inset);
}
.roll-frame .roll-caption .roll-dims { color: var(--ink-faint); }

.print-hint {
  font-size: var(--t-meta);
  color: var(--ink-soft);
  text-align: center;
  margin: 10px 0 0;
}
.print-hint strong { color: var(--ink); }
.print-hint em { color: var(--status-danger); font-style: normal; font-weight: 600; }

/* ── tweaks card ─────────────────────────────────────────────── */
.tweaks {
  margin-top: 24px;
  border-top: 1px solid var(--border-soft);
}
.tweaks-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: var(--h-elem);
  padding: 0 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  font: inherit;
  color: var(--ink-soft);
  font-weight: 500;
}
.tweaks-toggle:hover { color: var(--ink); }
.tweaks-toggle .tweaks-chevron {
  transition: transform .2s;
  color: var(--ink-faint);
  font-size: 0.85rem;
}
.tweaks.is-open .tweaks-chevron { transform: rotate(90deg); }
.tweaks-body {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--r-elem);
  padding: 18px;
  margin-top: 8px;
}
.tweaks-body .field:not(:last-child) { margin-bottom: 16px; }

/* ── welcome modal ────────────────────────────────────────────── */
.welcome-modal .modal-background { background: rgba(20, 25, 35, .5) !important; }
.welcome-card {
  background: var(--paper);
  border-radius: var(--r-card);
  max-width: 440px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.welcome-card .welcome-head {
  padding: 24px 24px 6px;
}
.welcome-card .welcome-title {
  font-size: var(--t-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 4px;
}
.welcome-card .welcome-subtitle {
  font-size: var(--t-meta);
  color: var(--ink-faint);
  margin: 0;
}
.welcome-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 20px;
}
.welcome-pick {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-elem);
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color .15s, background .15s;
}
.welcome-pick:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.welcome-pick .pick-size {
  font-weight: 600;
  font-size: var(--t-body);
  color: var(--ink);
}
.welcome-pick .pick-flag {
  font-size: var(--t-meta);
  color: var(--ink-faint);
  margin-left: 4px;
}
.welcome-pick .pick-devices {
  display: block;
  font-size: var(--t-meta);
  color: var(--ink-soft);
  margin-top: 2px;
}
.welcome-grid .welcome-help {
  font-size: var(--t-meta);
  color: var(--ink-faint);
  text-align: center;
  margin: 6px 0 0;
}
.welcome-grid .welcome-help em { color: var(--ink-soft); font-style: normal; }

/* ── mobile fine-tunes ───────────────────────────────────────── */
@media (max-width: 480px) {
  body { padding: 12px 0; }
  .app-header { padding: 14px 16px; }
  .app-body { padding: 18px 16px; }
  .app-footer { padding: 14px 16px; }
  .brand { font-size: 1rem; }
}
