:root {
  --bg: #eef4ff;
  --bg-2: #f8fbff;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --panel-soft: #f3f7ff;
  --muted: #53657d;
  --muted-strong: #1e2a3a;
  --text: #0f172a;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #e8f0ff;
  --accent-warm: #fbbf24;
  --success: #0f766e;
  --border: rgba(148, 163, 184, 0.26);
  --shadow: rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(251, 191, 36, 0.12), transparent 24%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
  color: var(--text);
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: -20% auto auto -10%;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(96, 165, 250, 0.08);
  filter: blur(20px);
  pointer-events: none;
}

.page-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 44px 20px 72px;
  position: relative;
  z-index: 1;
}

.topbar {
  margin-bottom: 28px;
}

.brand-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: block;
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.14);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 800;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(37, 99, 235, 0.12);
  color: var(--accent-strong);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(2.4rem, 5vw, 4rem);
  letter-spacing: -0.07em;
  line-height: 0.96;
  color: var(--muted-strong);
  font-weight: 900;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
  font-size: 1.02rem;
  line-height: 1.6;
}

.app-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.09), 0 2px 0 rgba(255, 255, 255, 0.7) inset;
  padding: 28px;
}

.preview-strip {
  margin-bottom: 22px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(240, 246, 255, 0.9), rgba(255, 255, 255, 0.8));
}

.preview-art {
  display: block;
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 18px 30px rgba(37, 99, 235, 0.09);
}

.form-section {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px 20px 20px;
  margin: 0 0 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(243, 247, 255, 0.7));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.form-section legend {
  padding: 0 8px;
  color: var(--accent-strong);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.field-row:last-child {
  margin-bottom: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.field > span {
  font-weight: 700;
  color: var(--muted-strong);
}

.field-wide {
  grid-column: 1 / -1;
}

.photo-field {
  grid-column: 1 / -1;
}

.photo-picker {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.photo-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(37, 99, 235, 0.2);
  background: linear-gradient(135deg, rgba(232, 240, 255, 1), rgba(255, 255, 255, 1));
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.15);
}

.photo-picker-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
  min-width: 0;
}

.photo-picker-controls input[type="file"] {
  width: min(100%, 340px);
  max-width: 100%;
  flex: 1 1 220px;
  min-width: 0;
}

.photo-picker-controls input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
  cursor: pointer;
}

input,
textarea {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  padding: 11px 12px;
  color: var(--text);
  font-size: 0.96rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
  min-height: 44px;
}

input:hover,
textarea:hover {
  border-color: rgba(37, 99, 235, 0.32);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.6);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

textarea {
  resize: vertical;
  min-height: 118px;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.btn-primary,
.btn-secondary {
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.btn-secondary {
  background: rgba(148, 163, 184, 0.04);
  border: 1px solid var(--border);
  color: var(--muted-strong);
}

.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
}

.btn-primary:active,
.btn-secondary:active {
  transform: translateY(0);
}

.result-panel {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.result-panel h2 {
  margin: 0 0 18px;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  color: var(--muted-strong);
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 22px;
}

.qr-box,
.vcf-box {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(243, 247, 255, 0.76));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.qr-code {
  background: #ffffff;
  border-radius: 16px;
  padding: 12px;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.qr-code svg {
  width: 100%;
  height: 100%;
}

.qr-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.vcf-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vcf-name {
  margin: 0;
  font-weight: 800;
  color: var(--success);
  font-size: 1.1rem;
}

.vcf-preview {
  margin: 0;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  padding: 14px;
  font-size: 0.8rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow-y: auto;
  color: #ebf3ff;
}

@media (max-width: 720px) {
  .app-card {
    padding: 18px;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .page-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .photo-picker {
    flex-direction: column;
    align-items: flex-start;
  }

  .photo-picker-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .photo-picker-controls input[type="file"],
  .photo-picker-controls .btn-secondary {
    width: 100%;
    max-width: none;
  }

  .photo-preview {
    width: 88px;
    height: 88px;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .form-actions {
    flex-direction: column;
  }
}

