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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f0f4f8;
  color: #1a2733;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(20, 40, 60, 0.12);
  padding: 2.5rem 2rem 2rem;
  width: 100%;
  max-width: 26rem;
}

.lang-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
}
.lang-toggle button {
  border: 1px solid #cbd5e0;
  background: #fff;
  color: #64748b;
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
}
.lang-toggle button:first-child { border-radius: 5px 0 0 5px; border-right: none; }
.lang-toggle button:last-child { border-radius: 0 5px 5px 0; }
.lang-toggle button.active { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }

h1 { font-size: 1.4rem; margin-bottom: 0.6rem; }
.intro { font-size: 0.92rem; color: #4a5a6a; margin-bottom: 1.5rem; line-height: 1.45; }

label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; }

.input-group {
  display: flex;
  width: 100%;
  margin-bottom: 0.35rem;
}
.input-group .prefix {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  background: #eef2f7;
  border: 1px solid #cbd5e0;
  border-right: none;
  border-radius: 8px 0 0 8px;
  font-weight: 600;
  color: #334155;
}
.input-group input {
  flex: 1;
  min-width: 0;
  border: 1px solid #cbd5e0;
  border-radius: 0 8px 8px 0;
  padding: 0.65rem 0.75rem;
  font-size: 1.05rem;
}
input:focus { outline: 2px solid #1d4ed8; outline-offset: -1px; }

.hint { font-size: 0.78rem; color: #64748b; margin-bottom: 0.5rem; }
.error { font-size: 0.83rem; color: #b91c1c; margin: 0.4rem 0; }

button.primary {
  width: 100%;
  margin-top: 0.9rem;
  background: #1d4ed8;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
button.primary:hover { background: #1e40af; }
button.primary:disabled { background: #93a8d8; cursor: default; }

button.secondary {
  width: 100%;
  margin-top: 0.6rem;
  background: #fff;
  color: #1d4ed8;
  border: 1px solid #1d4ed8;
  border-radius: 8px;
  padding: 0.6rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.number-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}
button.link {
  background: none;
  border: none;
  color: #1d4ed8;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  color: #334155;
  margin-bottom: 1.2rem;
  min-height: 1.5rem;
}

.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid #cbd5e0;
  border-top-color: #1d4ed8;
  border-radius: 50%;
  flex: none;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.code-input {
  width: 100%;
  border: 1px solid #cbd5e0;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font-size: 1.5rem;
  letter-spacing: 0.6rem;
  text-align: center;
}

.check {
  width: 3.2rem;
  height: 3.2rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.success { text-align: center; font-size: 1rem; color: #14532d; line-height: 1.5; }
