:root {
  --orange: #f96003;
  --text: #1e293b;
  --muted: #64748b;
  --bg: #f1f5f9;
  --card: #fff;
  --radius: 12px;
  --ok: #16a34a;
  --bad: #dc2626;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.dialog {
  width: 100%;
  max-width: 480px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.logo {
  display: block;
  height: auto;
}

.lang-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 10px;
  padding: 0;
  cursor: pointer;
  color: var(--text);
  opacity: 1;
}

.lang-toggle:hover,
.lang-toggle:focus-visible {
  border-color: var(--orange);
  color: var(--orange);
}

.lang-toggle:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.lang-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.lang-toggle-tip {
  position: absolute;
  z-index: 20;
  right: 0;
  top: calc(100% + 8px);
  padding: 6px 10px;
  background: #1e293b;
  color: #f8fafc;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  pointer-events: none;
}

.lang-toggle:hover .lang-toggle-tip,
.lang-toggle:focus-visible .lang-toggle-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.material-symbols-outlined {
  font-size: 22px;
  line-height: 1;
  vertical-align: middle;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
}

.title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

h1 {
  margin: 0;
  font-size: 1.5rem;
  flex: 1;
}

.info-btn {
  position: relative;
  border: 0;
  background: transparent;
  padding: 2px;
  cursor: help;
  color: var(--muted);
  border-radius: 50%;
  line-height: 0;
}

.info-btn:hover,
.info-btn:focus-visible {
  color: var(--orange);
}

.info-btn:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.info-tip {
  position: absolute;
  z-index: 20;
  right: 0;
  top: calc(100% + 8px);
  width: min(280px, 70vw);
  padding: 12px 14px;
  background: #1e293b;
  color: #f8fafc;
  font-size: 0.8125rem;
  line-height: 1.45;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  pointer-events: none;
  font-weight: 400;
  text-align: left;
}

.info-btn:hover .info-tip,
.info-btn:focus-visible .info-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lead {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.email-field {
  position: relative;
  margin-bottom: 16px;
}

.email-field input[type="email"] {
  width: 100%;
  padding: 12px 44px 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 1rem;
}

.email-status {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.email-status.ok {
  color: var(--ok);
  border: 2px solid var(--ok);
}

.email-status.bad {
  color: var(--bad);
  border: 2px solid var(--bad);
}

.email-status svg {
  width: 16px;
  height: 16px;
}

button[type="submit"] {
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 8px;
  background: var(--orange);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  background: #ecfdf5;
  color: #065f46;
  font-size: 0.9rem;
}

.status.error {
  background: #fef2f2;
  color: #991b1b;
}

.footer {
  margin-top: 20px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.footer a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.footer a:hover {
  color: var(--orange);
}

.footer-dot {
  color: #94a3b8;
}

.email-readonly {
  margin: 0 0 16px;
  word-break: break-all;
}

.prefs-list { margin-top: 4px; }

.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid #e2e8f0;
}

.pref-row.is-disabled {
  opacity: 0.55;
}

.pref-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.pref-text .hint {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0;
}

.badge-soon {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: 6px;
  vertical-align: middle;
}

.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch input:disabled + .slider {
  cursor: not-allowed;
  opacity: 0.5;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cbd5e1;
  border-radius: 30px;
  transition: 0.2s;
}

.slider::before {
  position: absolute;
  content: '';
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + .slider {
  background: var(--orange);
}

.switch input:checked + .slider::before {
  transform: translateX(22px);
}

.back-form-wrap {
  margin: 20px 0 0;
  text-align: center;
}

.text-link {
  color: var(--orange);
  font-weight: 600;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}
