:root {
  --bg-0: #f5f7fa;
  --panel: #ffffff;
  --panel-edge: rgba(18, 31, 43, 0.06);
  --text: #1f2933;
  --muted: #707579;
  --soft: #8b97a3;
  --accent: #3390ec;
  --accent-2: #5ba8f5;
  --danger: #d9536f;
  --success: #4f9e68;
  --line: #e6ecf0;
  --box: #f4f7f9;
  --box-active: #e8f3fd;
  --button-soft: #f4f7f9;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg-0);
}

body {
  min-height: 100vh;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 0;
  background: var(--bg-0);
}

.auth-panel {
  width: min(100%, 402px);
  min-height: 100vh;
  padding: 28px 32px 24px;
  border-radius: 0;
  background: var(--panel);
  border: 0;
  box-shadow: none;
  position: relative;
  overflow: hidden;
}

.hero-mark {
  position: relative;
  display: grid;
  place-items: center;
  padding-top: 18px;
  margin-bottom: 24px;
}

.hero-logo {
  position: relative;
  width: 132px;
  height: 132px;
  animation: logo-float 0.55s ease-out;
}

.hero-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.panel-copy,
.stage,
.feedback {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 400;
  text-align: center;
}

.subtitle {
  max-width: 290px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  text-align: center;
}

.stage {
  margin-top: 30px;
}

.stack {
  display: grid;
  gap: 16px;
}

.phone-field {
  position: relative;
}

.label {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.text-input {
  width: 100%;
  border: 1px solid #cfd9de;
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  padding: 15px 16px;
  font-size: 17px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.text-input.phone-input {
  padding-left: 18px;
  letter-spacing: 0.01em;
}

.text-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(51, 144, 236, 0.1);
}

.primary-button,
.secondary-button,
.ghost-button,
.digit {
  appearance: none;
  cursor: pointer;
  font: inherit;
}

.primary-button {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
}

.primary-button:disabled,
.secondary-button:disabled,
.digit:disabled,
.ghost-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.secondary-row {
  display: flex;
  gap: 10px;
}

.secondary-row-single .primary-button {
  width: 100%;
}

.secondary-button {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 16px;
  color: #4d5965;
  background: var(--button-soft);
}

.code-shell {
  display: grid;
  gap: 18px;
}

.code-boxes {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.code-boxes.passcode {
  grid-template-columns: repeat(4, 1fr);
}

.code-box {
  height: 58px;
  border-radius: 12px;
  border: 1px solid #d7e1e7;
  display: grid;
  place-items: center;
  background: var(--box);
  font-size: 22px;
  font-weight: 600;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.code-box.filled {
  background: var(--box-active);
  border-color: rgba(51, 144, 236, 0.5);
  transform: translateY(-1px);
}

.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.digit {
  min-height: 62px;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: #23303b;
  background: #fff;
  font-size: 25px;
  font-weight: 400;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}

.digit:active {
  transform: scale(0.98);
}

.feedback {
  min-height: 26px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.feedback.error {
  color: var(--danger);
}

.feedback.success {
  color: var(--success);
}

.success-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 12px;
  background: #f7fbff;
  border: 1px solid #d9e8f6;
}

.status-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 24px 18px;
  border-radius: 18px;
  border: 1px solid #e6ecf0;
  background: #ffffff;
  text-align: center;
}

.status-card-danger {
  background: #fff8f8;
  border-color: #f2d7dc;
}

.status-card-info {
  background: #f7fbff;
  border-color: #d9e8f6;
}

.status-card-success {
  background: #f6fcf8;
  border-color: #d5eadb;
}

.status-icon {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 56px;
  line-height: 1;
  font-weight: 500;
}

.status-icon-danger {
  background: #fbe4e8;
  color: #d9536f;
}

.status-icon-info {
  background: #e7f4ff;
  color: #3390ec;
}

.status-icon-success {
  background: #e3f5e8;
  color: #4f9e68;
}

.status-title {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 500;
  color: var(--text);
}

.success-title {
  font-size: 20px;
  font-weight: 500;
}

@keyframes logo-float {
  from {
    transform: translateY(18px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .shell {
    display: block;
  }

  .auth-panel {
    width: 100%;
    border-radius: 0;
    min-height: 100vh;
    padding: 0 24px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  h1 {
    font-size: 30px;
  }

  .hero-mark {
    padding-top: 0;
  }

  .code-box {
    height: 54px;
  }

  .digit {
    min-height: 56px;
  }
}
