:root {
  --bg: #f5f7ff;
  --bg-soft: #eef2ff;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --text: #111827;
  --muted: #5b6475;
  --line: rgba(99, 102, 241, 0.14);
  --line-strong: rgba(79, 70, 229, 0.22);
  --primary: #4f46e5;
  --primary-soft: #eef2ff;
  --accent: #0891b2;
  --accent-soft: #ecfeff;
  --success: #0f766e;
  --warning: #92400e;
  --shadow-lg: 0 20px 60px rgba(31, 41, 55, 0.12);
  --shadow-md: 0 14px 34px rgba(79, 70, 229, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --content-max: 1240px;
  --header-height: 88px;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at top left, rgba(79, 70, 229, 0.14), transparent 34%),
    radial-gradient(circle at right 10%, rgba(8, 145, 178, 0.12), transparent 26%),
    linear-gradient(180deg, #f8faff 0%, #eff4ff 100%);
  color: var(--text);
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

textarea {
  resize: vertical;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -52px;
  background: var(--text);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  z-index: 1000;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.container {
  width: min(calc(100% - 32px), var(--content-max));
  margin-inline: auto;
}

.site-header {
  padding-top: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: var(--header-height);
  padding: 12px 0 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  min-width: 0;
}

.brand img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(79, 70, 229, 0.18));
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--primary);
  font-weight: 800;
}

.brand-copy strong {
  font-size: clamp(1rem, 1.2vw + 0.8rem, 1.35rem);
  line-height: 1.2;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lang-switcher {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.lang-btn:hover,
.lang-btn:focus-visible {
  background: rgba(79, 70, 229, 0.08);
  color: var(--text);
  outline: none;
}

.lang-btn.is-active {
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.22);
}

.back-link {
  text-decoration: none;
  font-weight: 700;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  padding: 11px 16px;
  border-radius: 999px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.back-link:hover,
.back-link:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(79, 70, 229, 0.15);
  border-color: var(--line-strong);
  outline: none;
}

.hero {
  padding: 8px 0 20px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: 28px;
  align-items: center;
}

.hero-copy,
.hero-visual {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}

.hero-copy {
  padding: clamp(24px, 4vw, 44px);
}

.hero-visual {
  padding: 14px;
}

.hero-visual img {
  border-radius: calc(var(--radius-xl) - 10px);
  width: 100%;
  object-fit: cover;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  font-size: 0.84rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw + 0.8rem, 3.55rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.hero-text {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1vw + 0.7rem, 1.16rem);
  line-height: 1.75;
  max-width: 62ch;
}

.feature-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.12);
  color: var(--primary);
  font-weight: 700;
}

.main-content {
  padding: 18px 0 24px;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.panel {
  background: var(--panel);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
  padding: clamp(20px, 2.5vw, 32px);
}

.panel-head {
  margin-bottom: 22px;
}

.panel-head h2 {
  margin: 0;
  font-size: clamp(1.34rem, 1vw + 1rem, 1.9rem);
  line-height: 1.15;
}

.panel-head p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

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

.field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
  font-size: 0.96rem;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.94);
  padding: 14px 16px;
  color: var(--text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.field textarea {
  min-height: 122px;
  line-height: 1.55;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #8390a4;
}

.field input:hover,
.field textarea:hover,
.field select:hover {
  border-color: rgba(99, 102, 241, 0.28);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: rgba(79, 70, 229, 0.54);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
  background: #fff;
}


.field select {
  min-height: 51px;
  cursor: pointer;
}

.logo-upload-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.logo-upload-row input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-picker {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 999px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid rgba(79, 70, 229, 0.18);
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.file-picker:hover,
.file-picker:focus-within {
  transform: translateY(-1px);
  border-color: rgba(79, 70, 229, 0.34);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.12);
}

.btn-small {
  padding: 10px 14px;
  font-size: 0.9rem;
}

.field-help {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff;
  box-shadow: 0 16px 30px rgba(79, 70, 229, 0.26);
}

.btn-pdf {
  background: linear-gradient(135deg, #0f766e, #0d9488);
  color: #fff;
  box-shadow: 0 14px 28px rgba(13, 148, 136, 0.22);
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px dashed rgba(148, 163, 184, 0.48);
}

.status-message {
  min-height: 26px;
  margin: 16px 0 0;
  font-size: 0.95rem;
  color: var(--success);
  font-weight: 700;
}

.minutes-preview {
  --document-font: Arial, Helvetica, sans-serif;
  font-family: var(--document-font);
  background: linear-gradient(180deg, #ffffff 0%, #fcfcff 100%);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: calc(var(--radius-xl) - 6px);
  padding: clamp(20px, 3vw, 34px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 18px 35px rgba(15, 23, 42, 0.06);
}

.minutes-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
}

.minutes-kicker {
  margin: 0 0 8px;
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.minutes-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.preview-logo {
  width: auto;
  max-width: 150px;
  height: auto;
  max-height: 64px;
  object-fit: contain;
  flex: 0 0 auto;
}

.minutes-header h3 {
  margin: 0;
  font-size: clamp(1.5rem, 1.2vw + 1.1rem, 2rem);
  line-height: 1.14;
}

.minutes-date-block {
  min-width: 120px;
  text-align: right;
}

.meta-label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  font-weight: 800;
}

.minutes-section {
  padding-top: 18px;
}

.minutes-section + .minutes-section {
  border-top: 1px dashed rgba(148, 163, 184, 0.2);
  margin-top: 18px;
}

.minutes-section h4 {
  margin: 0 0 10px;
  font-size: 1.04rem;
}

.item-list {
  margin: 0;
  padding-left: 22px;
  color: var(--text);
  line-height: 1.68;
}

.item-list li + li {
  margin-top: 8px;
}

.empty-list {
  color: var(--muted);
}

.seo-section {
  padding: 8px 0 28px;
}

.seo-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
}

.seo-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: clamp(22px, 2.5vw, 32px);
}

.seo-card h2 {
  margin: 0 0 14px;
  font-size: clamp(1.28rem, 1vw + 0.95rem, 1.85rem);
  line-height: 1.16;
}

.seo-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

.seo-list {
  margin: 0;
  padding-left: 22px;
  line-height: 1.7;
}

.seo-list li + li {
  margin-top: 10px;
}

.site-footer {
  padding: 8px 0 32px;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 8px;
}

.footer-content p {
  margin: 0;
  color: var(--muted);
}

.footer-content a {
  color: var(--primary);
  font-weight: 700;
}

.footer-link {
  background: rgba(255, 255, 255, 0.82);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1080px) {
  .hero-grid,
  .app-grid,
  .seo-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    order: -1;
  }
}

@media (max-width: 760px) {
  .container {
    width: min(calc(100% - 24px), var(--content-max));
  }

  .topbar,
  .footer-content,
  .minutes-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions,
  .button-row {
    width: 100%;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .lang-switcher {
    order: 1;
  }

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

  .minutes-brand {
    width: 100%;
    flex-wrap: wrap;
  }

  .preview-logo {
    max-width: 130px;
    max-height: 56px;
  }

  .minutes-date-block {
    text-align: left;
    min-width: 0;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  @page {
    size: auto;
    margin: 15mm;
  }

  body {
    background: #fff;
  }

  .site-header,
  .panel-form,
  .seo-section,
  .site-footer,
  .skip-link {
    display: none !important;
  }

  .main-content {
    padding: 0;
  }

  .app-grid {
    display: block;
  }

  .panel-preview {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .panel-preview .panel-head {
    display: none;
  }

  .minutes-preview {
    box-shadow: none;
    border: 0;
    padding: 0;
    border-radius: 0;
  }

  .minutes-section + .minutes-section {
    page-break-inside: avoid;
  }
}
