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

:root {
  --blue: #1a4fa0;
  --blue-dark: #123a78;
  --green: #1d7a3e;
  --text: #1c1c1c;
  --bg: #faf7f2;
}

body {
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 20px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  text-align: center;
}

h1 { font-size: 2.2rem; margin-bottom: 4px; }
h2 { font-size: 1.7rem; margin-bottom: 12px; }
.subtitle { font-size: 1.1rem; margin-bottom: 28px; }

section { margin-top: 8px; }

.lang-toggle {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}
.lang-toggle button {
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: 700;
  background: #fff;
  color: var(--text);
  border: 2px solid #bbb;
  border-radius: 20px;
  cursor: pointer;
}
.lang-toggle button.selected {
  border-color: var(--blue);
  background: #eef4ff;
  color: var(--blue-dark);
}

.step-label {
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.big-button {
  display: inline-block;
  width: 100%;
  max-width: 480px;
  padding: 20px 24px;
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  background: var(--blue);
  border: 3px solid var(--blue-dark);
  border-radius: 14px;
  cursor: pointer;
  margin: 8px 0;
}
.big-button:hover, .big-button:focus-visible { background: var(--blue-dark); }
.big-button.secondary { background: var(--green); border-color: #14582c; }
.big-button.secondary:hover { background: #14582c; }
.big-button:focus-visible, button:focus-visible {
  outline: 4px solid #ffb300;
  outline-offset: 2px;
}

#file-input { position: absolute; width: 1px; height: 1px; opacity: 0; }

#dropzone {
  border: 3px dashed #999;
  border-radius: 18px;
  padding: 48px 24px;
  background: #fff;
}
#dropzone.dragover { border-color: var(--blue); background: #eef4ff; }

.hint { font-size: 1rem; color: #555; margin-top: 10px; }
.privacy { margin-top: 24px; font-size: 1rem; color: #555; }

.chosen-photo { margin-bottom: 20px; }
#thumbnail {
  max-width: 220px;
  max-height: 220px;
  border-radius: 12px;
  border: 3px solid #ccc;
  display: block;
  margin: 0 auto 8px;
}

.link-button {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 1.05rem;
  text-decoration: underline;
  cursor: pointer;
  margin-top: 16px;
}

fieldset { border: none; margin: 22px 0; }
legend {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
  width: 100%;
}

.choices { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.choices button {
  flex: 1 1 150px;
  max-width: 200px;
  padding: 14px 10px;
  font-size: 1.15rem;
  font-weight: 700;
  background: #fff;
  color: var(--text);
  border: 3px solid #bbb;
  border-radius: 12px;
  cursor: pointer;
}
.choices button .btn-label { display: block; }
.choices button .btn-hint {
  display: block;
  font-size: 0.85rem;
  font-weight: 400;
  color: #555;
  margin-top: 6px;
}
.choices button.selected {
  border-color: var(--blue);
  background: #eef4ff;
  color: var(--blue-dark);
}

.spinner {
  width: 72px;
  height: 72px;
  margin: 48px auto 24px;
  border: 8px solid #ddd;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 1.4rem; font-weight: 700; }

#result-preview {
  max-width: 100%;
  border: 3px solid #ccc;
  border-radius: 12px;
  margin: 16px 0;
}
.stats { font-size: 1.05rem; color: #444; }
.downloads { display: flex; flex-direction: column; align-items: center; }

.error-text { font-size: 1.15rem; margin: 12px 0 20px; }

@media (max-width: 480px) {
  body { font-size: 18px; }
  #dropzone { padding: 32px 12px; }
}
