*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #000;
  --surface:   #0f0f0f;
  --surface2:  #181818;
  --border:    rgba(255,255,255,0.08);
  --gold:      #c9a84c;
  --gold-dim:  rgba(201,168,76,0.15);
  --text:      #ffffff;
  --text-muted:#888;
  --text-dim:  rgba(255,255,255,0.6);
  --input-bg:  rgba(255,255,255,0.04);
  --radius:    12px;
  --radius-sm: 8px;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  padding: 0;
  line-height: 1.5;
}

/* ─── Language Selector ─────────────────────────────── */
#lang-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 5px 12px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.lang-btn:hover { color: var(--text); border-color: var(--border); background: rgba(255,255,255,0.05); }
.lang-btn.active { color: var(--gold); border-color: var(--gold); background: var(--gold-dim); }
.lang-btn .flag { font-size: 18px; line-height: 1; }

/* ─── Page Layout ───────────────────────────────────── */
#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* ─── Header ────────────────────────────────────────── */
.site-header {
  text-align: center;
  padding: 20px 0 24px;
}

#company-logo {
  max-height: 72px;
  max-width: 200px;
  object-fit: contain;
  display: block;
  margin: 0 auto 16px;
}
#company-logo.hidden { display: none; }

#company-name {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

#company-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
}

/* ─── Card ───────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  margin-bottom: 20px;
}

/* ─── Form Fields ────────────────────────────────────── */
.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 16px;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  font-family: inherit;
  -webkit-appearance: none;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(255,255,255,0.2);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--gold);
  background: rgba(201,168,76,0.05);
}

.field input.error,
.field textarea.error {
  border-color: #e53e3e;
}

.field-error {
  font-size: 12px;
  color: #fc8181;
  margin-top: 6px;
  display: none;
}

.field-error.visible { display: block; }

/* ─── Signature Canvas ───────────────────────────────── */
.signature-wrap {
  position: relative;
}

#signature-canvas {
  width: 100%;
  height: 160px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: block;
  cursor: crosshair;
  touch-action: none;
}

#signature-canvas.active { border-color: var(--gold); }

.sig-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 12px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-ghost:hover { border-color: #555; color: var(--text); }

.sig-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
}

/* ─── GDPR ───────────────────────────────────────────── */
.gdpr-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.gdpr-row input[type=checkbox] {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  cursor: pointer;
  accent-color: var(--gold);
}

.gdpr-row label {
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1.5;
}

.gdpr-row a {
  color: var(--gold);
  text-decoration: none;
}
.gdpr-row a:hover { text-decoration: underline; }

/* ─── Submit Button ──────────────────────────────────── */
.btn-submit {
  width: 100%;
  background: var(--gold);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  padding: 18px;
  cursor: pointer;
  margin-top: 20px;
  transition: opacity 0.2s, transform 0.1s;
  letter-spacing: 0.5px;
}
.btn-submit:hover  { opacity: 0.9; }
.btn-submit:active { transform: scale(0.99); }
.btn-submit:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Success Screen ─────────────────────────────────── */
#success-screen {
  display: none;
  text-align: center;
  padding: 60px 24px;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 36px;
}

#success-screen h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
}

#success-screen p {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 320px;
  margin: 0 auto;
}

/* ─── Privacy Modal ──────────────────────────────────── */
#privacy-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#privacy-modal.open { display: flex; }

.modal-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 540px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--text); }

.modal-body {
  padding: 24px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
  white-space: pre-wrap;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* ─── Toast ──────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #e53e3e;
  color: #fff;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: 8px;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
  pointer-events: none;
}
#toast.show { opacity: 1; }

/* ─── Loader ─────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Responsive ─────────────────────────────────────── */

/* Small mobile (< 400px) */
@media (max-width: 400px) {
  html { font-size: 15px; }
  #app { padding: 16px 12px 40px; }
  .card { padding: 20px 16px; }
  #company-name { font-size: 22px; }
  .field input, .field select, .field textarea { font-size: 15px; padding: 12px 14px; }
  .btn-submit { font-size: 15px; padding: 16px; }
  #signature-canvas { height: 140px; }
}

/* Tablet / desktop (≥ 520px) — everything 50% larger than base */
@media (min-width: 520px) {
  html { font-size: 24px; }
  #app { padding: 36px 24px 72px; max-width: 720px; }
  .card { padding: 42px 36px; }
  #company-name { font-size: 39px; }
  #company-subtitle { font-size: 21px; }
  .card-title { font-size: 19px; }
  .field label { font-size: 18px; }
  .field input, .field select, .field textarea { font-size: 24px; padding: 21px 24px; }
  .btn-submit { font-size: 24px; padding: 27px; }
  .btn-ghost { font-size: 18px; padding: 9px 21px; }
  .sig-hint { font-size: 16px; }
  #signature-canvas { height: 240px; }
  .lang-btn { font-size: 19px; padding: 7px 18px; }
  .lang-btn .flag { font-size: 27px; }
  .gdpr-row label { font-size: 19px; }
  .gdpr-row input[type=checkbox] { width: 30px; height: 30px; }
}

/* 13" FHD kiosk: narrow viewport in a browser window */
@media (min-width: 768px) {
  #app { max-width: 800px; padding: 48px 48px 96px; }
  .card { padding: 42px 48px; }
}

/* Wide desktop */
@media (min-width: 1024px) {
  #app { max-width: 870px; }
}
