* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
}

body {
  background: #f9f9f9;
  color: #000;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  transition: background 0.3s;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

body.dark {
  background: #121212;
  color: #fff;
}

.steps {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.step {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d0d0d0;
}

.step.active {
  background: #0088cc;
}

.container {
  width: 100%;
  max-width: 360px;
  background: #fff;
  padding: 28px;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  text-align: center;
  transition: all 0.3s ease;
  opacity: 1;
  transform: translateY(0);
}

.container.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  position: absolute;
}

body.dark .container {
  background: #1e1e1e;
}

.emoji {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  display: block;
}

h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
}

p {
  color: #666;
  font-size: 15px;
  margin-bottom: 24px;
  line-height: 1.4;
}

body.dark p {
  color: #aaa;
}

.input-group {
  margin-bottom: 20px;
  text-align: left;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 500;
  color: #333;
}

body.dark label {
  color: #ddd;
}

input, select {
  width: 100%;
  padding: 14px;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 16px;
  background: #fff;
  transition: border-color 0.2s;
}

body.dark input,
body.dark select {
  background: #2d2d2d;
  border-color: #444;
  color: #fff;
}

input:focus,
select:focus {
  outline: none;
  border-color: #0088cc;
}

/* Префикс телефона */
.phone-input-with-prefix {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  transition: border-color 0.2s;
}

body.dark .phone-input-with-prefix {
  background: #2d2d2d;
  border-color: #444;
}

.phone-input-with-prefix:focus-within {
  border-color: #0088cc;
}

#phonePrefix {
  font-weight: bold;
  font-size: 16px;
  margin-right: 10px;
  color: #0088cc;
  min-width: 36px;
  text-align: left;
}

#phone {
  border: none;
  outline: none;
  padding: 14px 0;
  font-size: 16px;
  background: transparent;
  flex: 1;
  color: inherit;
}

/* Код */
.code-input {
  text-align: center;
  letter-spacing: 6px;
  font-size: 20px;
  font-family: monospace;
}

/* Пароль */
.password-input-wrapper {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 14px;
  top: 42px;
  color: #666;
  cursor: pointer;
  font-size: 18px;
}

body.dark .password-toggle {
  color: #aaa;
}

/* Чекбокс */
.keep-signed label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: normal;
}

.keep-signed input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #0088cc;
}

/* Ошибки */
.error {
  color: #e74c3c;
  font-size: 14px;
  min-height: 18px;
  margin-top: 6px;
}

/* Кнопки */
.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 600;
  color: white;
  background: #0088cc;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Селект */
.country-selector {
  position: relative;
}

.country-selector::after {
  content: "▼";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #666;
  font-size: 12px;
}

body.dark .country-selector::after {
  color: #aaa;
}

select {
  appearance: none;
  -webkit-appearance: none;
}