:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #172033;
  --muted: #637083;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --border: #d9e1ef;
  --success: #12805c;
  --danger: #b42318;
  --shadow: 0 20px 45px rgba(23, 32, 51, 0.08);
  font-family: Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(circle at top left, #e9f1ff, var(--bg) 35%, #f8fafc);
  min-height: 100vh;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0;
}

.hero {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--primary);
  font-weight: 700;
  margin: 0 0 10px;
}

h1 {
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.08;
  margin: 0;
}

.lead {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
  max-width: 820px;
  margin: 18px 0 0;
}

.privacy-card {
  background: linear-gradient(135deg, #16325c, #2563eb);
  border-radius: 26px;
  color: white;
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  box-shadow: var(--shadow);
}

.privacy-card strong {
  font-size: 24px;
}

.privacy-card span {
  line-height: 1.7;
  opacity: 0.95;
}

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

.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 26px;
  backdrop-filter: blur(12px);
}

h2 {
  font-size: 20px;
  margin: 0 0 16px;
}

.file-box {
  display: grid;
  gap: 8px;
  border: 2px dashed #b7c5dc;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
  background: #f8fbff;
  cursor: pointer;
  transition: 0.2s ease;
}

.file-box:hover {
  border-color: var(--primary);
  background: #eef5ff;
}

.file-box input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.file-title {
  font-weight: 700;
}

.file-hint {
  color: var(--muted);
  font-size: 14px;
  direction: ltr;
  text-align: right;
}

.field {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.field label {
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

select {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  font-size: 16px;
  background: white;
  color: var(--text);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 22px;
}

button,
.download {
  border: 0;
  border-radius: 16px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.primary {
  background: var(--primary);
  color: white;
}

.primary:hover {
  background: var(--primary-dark);
}

.primary:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.download {
  background: #e8fff5;
  color: var(--success);
  border: 1px solid #9be7c4;
}

.hidden {
  display: none !important;
}

.note {
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
  margin: 18px 0 0;
}

.preview-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.preview {
  min-height: 260px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background:
    linear-gradient(45deg, #edf2fa 25%, transparent 25%),
    linear-gradient(-45deg, #edf2fa 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #edf2fa 75%),
    linear-gradient(-45deg, transparent 75%, #edf2fa 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  text-align: center;
  color: var(--muted);
}

.preview img {
  max-width: 70%;
  max-height: 190px;
  object-fit: contain;
  opacity: 0.35;
}

.status {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #f8fbff;
  padding: 16px;
  color: var(--muted);
  line-height: 1.7;
}

.status.success {
  color: var(--success);
  border-color: #9be7c4;
  background: #effdf7;
}

.status.error {
  color: var(--danger);
  border-color: #f5b5ad;
  background: #fff5f3;
}

.how-it-works {
  border-radius: 22px;
  background: #f8fbff;
  padding: 18px;
}

.how-it-works h3 {
  margin: 0 0 12px;
}

.how-it-works ol {
  margin: 0;
  padding-inline-start: 22px;
  color: var(--muted);
  line-height: 1.9;
}

.docx-render-area {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 794px;
  background: white;
  color: black;
  padding: 48px;
  font-family: Arial, sans-serif;
  line-height: 1.6;
}

.docx-render-area img {
  max-width: 100%;
}

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

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