:root {
  color-scheme: light;
  --bg: #f7f1e7;
  --bg-2: #efe4d4;
  --ink: #2c2a28;
  --muted: #6a5f55;
  --accent: #c77943;
  --card: rgba(255, 255, 255, 0.88);
  --shadow: 0 24px 60px rgba(63, 52, 39, 0.18);
  --radius: 18px;
  --transition: 180ms ease;
}

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

body {
  min-height: 100vh;
  font-family: "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 10% 10%, #f2e8da 0%, transparent 60%),
    radial-gradient(700px 400px at 90% 20%, #f3dcc1 0%, transparent 58%),
    linear-gradient(135deg, var(--bg), var(--bg-2));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.page {
  width: min(920px, 100%);
  display: grid;
  gap: 32px;
  animation: fadeIn 500ms ease;
}

.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 24px;
}

.header-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

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

.badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: conic-gradient(from 120deg, #c77943, #e0b180, #d08c5c, #c77943);
  box-shadow: 0 10px 24px rgba(199, 121, 67, 0.35);
}

.brand-text h1 {
  font-size: clamp(28px, 3vw, 36px);
  letter-spacing: -0.02em;
}

.overline {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}

.subtitle {
  margin-top: 8px;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.5;
}

.text-link {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.text-link:hover,
.text-link:focus {
  text-decoration: underline;
}

.lang {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  justify-self: end;
}

.lang select {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(80, 60, 40, 0.2);
  background: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  transition: border var(--transition), box-shadow var(--transition);
}

.lang select:focus {
  outline: none;
  border-color: rgba(199, 121, 67, 0.6);
  box-shadow: 0 0 0 3px rgba(199, 121, 67, 0.2);
}

main {
  display: flex;
  justify-content: center;
}

.home-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
  gap: 24px;
  align-items: start;
}

.features {
  width: 100%;
}

.features h2 {
  font-size: clamp(18px, 2.2vw, 24px);
}

.features-intro {
  color: var(--muted);
  line-height: 1.5;
}

.features-list {
  display: grid;
  gap: 10px;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.policy-main {
  justify-content: center;
}

.card {
  width: min(520px, 100%);
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  display: grid;
  gap: 18px;
  transform: translateY(0);
  animation: riseIn 480ms ease;
}

.field {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

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

input[type="text"],
input[type="password"] {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(80, 60, 40, 0.2);
  background: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  color: var(--ink);
  transition: border var(--transition), box-shadow var(--transition);
}

.input-hint {
  display: none;
  font-size: 12px;
  color: #9b4f35;
}

.field.invalid .input-hint {
  display: block;
}

.field.invalid input[type="text"],
.field.invalid input[type="password"] {
  border-color: rgba(155, 79, 53, 0.7);
  box-shadow: 0 0 0 3px rgba(155, 79, 53, 0.15);
}

input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: rgba(199, 121, 67, 0.6);
  box-shadow: 0 0 0 3px rgba(199, 121, 67, 0.18);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox input {
  width: 16px;
  height: 16px;
}

.primary {
  padding: 12px 18px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #c77943, #df9f69);
  color: #fff8f1;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  box-shadow: 0 12px 24px rgba(199, 121, 67, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.primary:disabled {
  cursor: default;
  opacity: 0.65;
  box-shadow: none;
}

.primary:not(:disabled):hover {
  transform: translateY(-1px);
}

.primary.secondary {
  background: linear-gradient(135deg, #7e6b56, #9a846e);
  box-shadow: 0 10px 20px rgba(91, 76, 61, 0.22);
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 248, 241, 0.45);
  border-top-color: #fff8f1;
  display: none;
  animation: spin 900ms linear infinite;
}

.primary.is-loading .spinner {
  display: inline-block;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.status {
  min-height: 18px;
  font-size: 13px;
  color: #9b4f35;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.footer-links {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}

.footer-links a {
  color: var(--accent);
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus {
  text-decoration: underline;
}

.policy {
  width: min(760px, 100%);
  line-height: 1.65;
}

.policy-header h2 {
  font-size: clamp(20px, 2.6vw, 28px);
  margin-bottom: 8px;
}

.policy-lead {
  color: var(--muted);
  font-size: 14px;
}

.policy-notice {
  margin-top: 14px;
  color: #8b4530;
}

.policy-body p + p {
  margin-top: 14px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .site-header {
    grid-template-columns: 1fr;
  }

  .header-controls {
    align-items: flex-start;
  }

  .lang {
    justify-self: start;
  }

  .brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .badge {
    width: 44px;
    height: 44px;
  }

  .card {
    padding: 22px;
  }

  .home-main {
    grid-template-columns: 1fr;
  }
}
