:root {
  --bg: #f4f4f5;
  --card: #ffffff;
  --card-border: #e4e4e7;
  --surface: #fafafa;
  --text: #18181b;
  --muted: #71717a;
  --muted-soft: #a1a1aa;
  --line: #d4d4d8;
  --orange: #f97316;
  --orange-soft: rgba(249, 115, 22, 0.12);
  --orange-bg: #fff7ed;
  --orange-border: #fed7aa;
  --orange-text: #9a3412;
  --shadow: 0 24px 54px rgba(161, 161, 170, 0.22);
  --shadow-soft: 0 14px 30px rgba(161, 161, 170, 0.16);
  --radius: 28px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
}

button, input {
  font: inherit;
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at top, var(--orange-soft), transparent 35%),
    linear-gradient(to bottom, #fafafa, #f4f4f5);
}

.auth-shell {
  width: 100%;
  max-width: 460px;
}

.auth-card {
  width: 100%;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 28px;
  box-shadow: var(--shadow);
}

.auth-header {
  margin-bottom: 32px;
}

.auth-logo {
  display: block;
  width: 300px;
  height: auto;
  margin-bottom: 18px;
}

.auth-title {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.auth-subtitle {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field-group {
  display: flex;
  flex-direction: column;
}

.field-label {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.phone-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.phone-input {
  flex: 1;
  min-width: 0;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  background: #ffffff;
  color: var(--text);
  font-size: 15px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.9) inset, var(--shadow-soft);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.phone-row[data-mode="locked"] .phone-input {
  background: #ffffff;
  color: var(--text);
  pointer-events: none;
}

.phone-row[data-mode="editing"] .phone-input {
  border-color: rgba(249, 115, 22, 0.38);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.08), var(--shadow-soft);
}

.phone-input::placeholder {
  color: var(--muted-soft);
}

.secondary-button,
.primary-button,
.text-button {
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.secondary-button {
  min-width: 112px;
  height: 52px;
  padding: 0 18px;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  background: #fafafa;
  color: #3f3f46;
  font-size: 14px;
  font-weight: 600;
}

.secondary-button:hover {
  background: #f4f4f5;
}

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

.code-box {
  position: relative;
  height: 72px;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.9) inset, var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: text;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.code-box.is-focused {
  border-color: rgba(249, 115, 22, 0.38);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.08), var(--shadow-soft);
}

.code-box.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.hidden-code-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.code-slots {
  display: grid;
  align-items: end;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 0 16px;
}

.code-slots--letters {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.code-slots--digits {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.code-slot {
  position: relative;
  height: 32px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.code-line {
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: var(--line);
  transition: background-color 0.18s ease;
}

.code-dot {
  position: absolute;
  top: 2px;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--text);
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.code-slot.is-filled .code-dot {
  opacity: 1;
}

.code-slot.is-filled .code-line {
  background: rgba(249, 115, 22, 0.55);
}

.notice {
  border-radius: 18px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.55;
}

.notice--error {
  border: 1px solid var(--orange-border);
  background: var(--orange-bg);
  color: var(--orange-text);
}

.notice--success {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.primary-button {
  width: 100%;
  height: 54px;
  border-radius: 18px;
  background: #18181b;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 18px 36px rgba(161, 161, 170, 0.24);
}

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

.primary-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.auth-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.text-button {
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.text-button:hover {
  color: var(--text);
}

@media (max-width: 560px) {
  .auth-page {
    padding: 16px;
    align-items: stretch;
  }

  .auth-shell {
    max-width: none;
  }

  .auth-card {
    min-height: calc(100vh - 32px);
    border-radius: 24px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .auth-logo {
    width: 72px;
  }

  .auth-title {
    font-size: 28px;
  }

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

  .phone-row {
    flex-direction: column;
  }

  .secondary-button {
    width: 100%;
  }
}


