:root {
  --primary: #00d1ff;
  --primary-dark: #00b3e6;
  --surface: rgba(30, 30, 46, 0.85);
  --border: rgba(0, 209, 255, 0.15);
  --text: #e0f7ff;
  --muted: #94a3b8;
  --valid: #22c55e;
  --invalid: #ef4444;
}

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

body {
  background-image: url("../img/photo_2026-06-30_12-14-00.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 40px 32px;
  max-width: 480px;
  width: 100%;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 14px;
  text-align: center;
  color: var(--primary);
  line-height: 1.15;
}

.subtitle {
  font-size: 1rem;
  color: #a0d8ff;
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.55;
}

.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 7px;
  color: #c0e0ff;
  font-weight: 500;
}

input {
  width: 100%;
  padding: 13px 16px;
  font-size: 1rem;
  border: 1px solid rgba(0, 209, 255, 0.3);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.6);
  color: white;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 209, 255, 0.18);
}

input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

.phone-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  padding: 0 12px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  transition:
    max-height 0.28s ease,
    opacity 0.22s ease,
    margin-top 0.24s ease,
    padding 0.24s ease,
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.phone-status::before {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.phone-status.valid {
  max-height: 44px;
  opacity: 1;
  margin-top: 8px;
  padding: 9px 12px;
  color: #4ade80;
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.28);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.06);
}

.phone-status.valid::before {
  content: '✓';
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
}

.phone-status.invalid {
  max-height: 44px;
  opacity: 1;
  margin-top: 8px;
  padding: 9px 12px;
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.28);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.06);
}

.phone-status.invalid::before {
  content: '⚠';
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
}

.phone-status.error {
  max-height: 44px;
  opacity: 1;
  margin-top: 8px;
  padding: 9px 12px;
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.28);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.06);
}

.phone-status.error::before {
  content: '!';
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
}

.btn-primary {
  display: block;
  width: 100%;
  padding: 15px;
  font-size: 1.05rem;
  font-weight: 600;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  color: #0a0e1a;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.22s, box-shadow 0.22s;
  box-shadow: 0 8px 24px rgba(0, 209, 255, 0.28);
  font-family: inherit;
  margin-top: 6px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 209, 255, 0.42);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-mini {
  display: inline-block;
  padding: 8px 20px;
  border: 1px solid rgba(0, 209, 255, 0.35);
  border-radius: 999px;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  font-family: inherit;
}

.btn-mini:hover {
  background: rgba(0, 209, 255, 0.08);
}

.btn-mini.copied {
  color: var(--valid);
  border-color: var(--valid);
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.btn-link:hover {
  color: #a0d8ff;
}

[hidden] { display: none !important; }

.loader {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin: 28px 0 20px;
}

.loader span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--primary);
  animation: ldot 1.2s ease-in-out infinite;
}

.loader span:nth-child(2) { animation-delay: 0.16s; }
.loader span:nth-child(3) { animation-delay: 0.32s; }

@keyframes ldot {
  0%, 100% { transform: scale(0.45); opacity: 0.35; }
  50% { transform: scale(1); opacity: 1; }
}

.step-title {
  font-size: 1.55rem;
  font-weight: 700;
  text-align: center;
  color: var(--primary);
  margin-bottom: 10px;
}

.step-text {
  text-align: center;
  color: var(--muted);
  font-size: 0.93rem;
  margin-bottom: 18px;
  line-height: 1.6;
}

.waiting-phone {
  text-align: center;
  font-size: 1.05rem;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 8px;
}

.pair-code {
  text-align: center;
  font-family: 'Courier New', monospace;
  font-size: clamp(26px, 8vw, 40px);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--primary);
  background: rgba(0, 209, 255, 0.06);
  border: 1px solid rgba(0, 209, 255, 0.22);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 18px 0;
  user-select: all;
}

.pair-actions {
  text-align: center;
  margin-bottom: 20px;
}

.howto {
  border: 1px solid rgba(0, 209, 255, 0.12);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.howto-line {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 7px 0;
  font-size: 13px;
  line-height: 1.5;
  color: #a0d8ff;
  border-bottom: 1px dashed rgba(0, 209, 255, 0.1);
}

.howto-line:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.howto-num {
  flex-shrink: 0;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--primary);
  color: #0a0e1a;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.skeleton-layer {
  display: none;
}

#step-code.is-loading .skeleton-layer {
  display: block;
}

#step-code.is-loading .code-content {
  display: none;
}

.code-content {
  animation: code-fadein 0.22s ease;
}

@keyframes code-fadein {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.skel {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.1)  50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: 8px;
}

.skel-title {
  height: 26px;
  width: 62%;
  margin: 0 auto 22px;
}

.skel-code-display {
  height: 76px;
  border-radius: 12px;
  margin-bottom: 18px;
}

.skel-center {
  text-align: center;
  margin-bottom: 20px;
}

.skel-copy {
  height: 34px;
  width: 128px;
  border-radius: 999px;
  display: inline-block;
}

.skel-instructions {
  border-radius: 10px;
  margin-bottom: 14px;
  padding: 10px 14px;
}

.skel-inner-line {
  height: 13px;
  border-radius: 6px;
  margin: 9px 0;
  background: rgba(255, 255, 255, 0.06);
}

.skel-inner-line--short {
  width: 70%;
}

.skel-tip-block {
  height: 46px;
  border-radius: 9px;
  margin-bottom: 14px;
}

.skel-conn {
  height: 13px;
  width: 58%;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 4px;
}

.skel-foot {
  height: 12px;
  width: 44%;
  border-radius: 6px;
  display: inline-block;
}

.howto-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 13px;
  border-radius: 9px;
  background: rgba(0, 209, 255, 0.06);
  border: 1px solid rgba(0, 209, 255, 0.18);
  font-size: 12.5px;
  color: #a0d8ff;
  line-height: 1.55;
}

.tip-label {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(0, 209, 255, 0.14);
  border-radius: 5px;
  padding: 3px 7px;
  margin-top: 1px;
}

.conn-status {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.footnote {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.success-icon {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.error-icon {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.stats {
  margin-top: 26px;
  display: flex;
  justify-content: center;
  gap: 28px;
  font-size: 0.88rem;
  color: var(--muted);
}

.stat-item strong {
  color: var(--primary);
  font-weight: 600;
}

.claimed-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d1ff, #fbbf24);
  color: #0a0e1a;
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  box-shadow: 0 0 0 8px rgba(0, 209, 255, 0.1);
}

.claimed-greeting {
  text-align: center;
  font-size: 1rem;
  color: #a0d8ff;
  margin-bottom: 18px;
}

.claimed-greeting strong {
  color: var(--primary);
}

.claimed-checklist {
  list-style: none;
  border: 1px solid rgba(0, 209, 255, 0.14);
  border-radius: 10px;
  padding: 6px 14px;
  margin-bottom: 18px;
}

.claimed-checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  font-size: 0.9rem;
  color: #a0d8ff;
  border-bottom: 1px dashed rgba(0, 209, 255, 0.1);
}

.claimed-checklist li:last-child {
  border-bottom: none;
}

.claimed-checklist .check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--valid);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.claimed-note {
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 18px;
}

.claimed-reset {
  text-align: center;
}

@media (max-width: 520px) {
  .container {
    padding: 26px 18px;
    border-radius: 12px;
  }

  h1 { font-size: 1.75rem; }
  .stats { gap: 18px; font-size: 0.82rem; }
}
