:root {
  --bg: #f3f3f6;
  --card: #ffffff;
  --text: #30323f;
  --muted: #757889;
  --line: #d8dbe4;
  --blue: #1978ea;
  --blue-hover: #0e67d3;
  --shadow: 0 20px 60px rgba(17, 24, 39, 0.08);
  --radius-xl: 28px;
  --radius-lg: 16px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: min(100%, 430px);
  min-height: 640px;
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 38px;
}

.form {
  display: grid;
  gap: 14px;
}

input {
  width: 100%;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0 18px;
  font-size: 18px;
  color: var(--text);
  outline: none;
}

input::placeholder {
  color: #8b8e9b;
}

input:focus {
  border-color: #a7c8ff;
  box-shadow: 0 0 0 4px rgba(25, 120, 234, 0.12);
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f6f7fb;
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
}

.mode-btn {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.mode-btn.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.08);
}

.primary,
.secondary {
  min-height: 58px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 17px;
  font-weight: 700;
}

.primary {
  border: 0;
  background: var(--blue);
  color: #fff;
}

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

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

.secondary {
  background: #f6f7fb;
  color: var(--text);
}

.error {
  min-height: 20px;
  margin: 0;
  color: #c1255a;
  font-size: 14px;
}

.result {
  margin-top: 24px;
  display: grid;
  gap: 18px;
}

.preview-wrap {
  background: #f8f9fc;
  border-radius: 22px;
  padding: 18px;
}

.preview {
  width: 100%;
  border-radius: 24px;
  display: block;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hidden {
  display: none;
}

.sr-only {
  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: 520px) {
  .card {
    padding: 24px;
    min-height: auto;
  }

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