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

:root {
  --red:        #cc0000;
  --red-dark:   #a30000;
  --red-brand:  #cc092f;
  --white:      #ffffff;
  --gray-100:   #f5f5f5;
  --gray-200:   #e8e8e8;
  --gray-400:   #bdbdbd;
  --gray-600:   #757575;
  --gray-800:   #424242;
  --green:      #2e7d32;
}

body {
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--red);
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 18% 18%, rgba(255,255,255,0.06) 0%, transparent 55%),
    radial-gradient(ellipse at 82% 85%, rgba(0,0,0,0.18) 0%, transparent 55%),
    linear-gradient(145deg, #d10000 0%, #8f0000 55%, #bb0008 100%);
  z-index: -1;
}

body::after {
  content: '';
  position: fixed;
  top: -160px; right: -160px;
  width: 520px; height: 520px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  z-index: -1;
}

/* ── HEADER ── */
.header {
  width: 100%;
  background: rgba(0,0,0,0.28);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 0 2rem;
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 70px;
}
.logo-wrapper { display: flex; align-items: center; gap: 14px; }
.logo-icon {
  width: 44px; height: 44px;
  background: var(--white);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.logo-text { color: var(--white); }
.logo-text .brand  { font-size: 1.3rem; font-weight: 700; line-height: 1.1; }
.logo-text .tagline{ font-size: 0.7rem; font-weight: 400; opacity: .8; text-transform: uppercase; letter-spacing: .5px; }

.header-badge {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px; padding: 6px 14px;
  color: var(--white); font-size: .78rem; font-weight: 500;
}
.header-badge .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4cff88;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,100%{ opacity:1; transform:scale(1); }
  50%    { opacity:.6; transform:scale(.8); }
}

/* ── LAYOUT ── */
.main {
  width: 100%; max-width: 1100px; margin: 0 auto;
  padding: 3rem 2rem;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 3rem; align-items: start;
}

/* ── LEFT PANEL ── */
.info-panel { color: var(--white); }

.module-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px; padding: 6px 16px;
  font-size: .78rem; font-weight: 600;
  letter-spacing: .5px; text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.module-badge svg { width: 14px; height: 14px; fill: currentColor; }

.info-panel h1 {
  font-size: 2.4rem; font-weight: 800; line-height: 1.15;
  margin-bottom: 1rem; text-shadow: 0 2px 8px rgba(0,0,0,0.22);
}
.info-panel h1 span { display: block; font-size: 1.5rem; font-weight: 400; opacity: .85; }

.info-panel .description {
  font-size: 1rem; line-height: 1.65; opacity: .85;
  margin-bottom: 2rem; font-weight: 300;
}

.features-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.features-list li { display: flex; align-items: center; gap: 14px; font-size: .92rem; font-weight: 500; }

/* Left panel version */
.feature-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,0.14);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.feature-icon svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Card version features */
.card-features { list-style: none; display: flex; flex-direction: column; gap: 0; width: 100%; margin-top: 1.5rem; border-top: 1px solid var(--gray-200); padding-top: 1.2rem; }
.card-features li {
  display: flex; align-items: center; gap: 12px;
  font-size: .82rem; font-weight: 500; color: var(--gray-800);
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
}
.card-features li:last-child { border-bottom: none; }
.card-feature-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: #fff0f0;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.card-feature-icon svg { width: 16px; height: 16px; fill: none; stroke: var(--red); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Card version info box */
.card-version-info {
  margin-top: 1rem;
  padding: 10px 14px;
  background: var(--gray-100);
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  display: flex; gap: 1.5rem;
  width: 100%;
}
.card-version-info .v-item { display: flex; flex-direction: column; gap: 2px; }
.card-version-info .v-label { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-400); }
.card-version-info .v-value { font-size: .85rem; font-weight: 700; color: var(--gray-800); }

.version-info {
  margin-top: 2.5rem; padding: 14px 18px;
  background: rgba(0,0,0,0.2);
  border-radius: 10px; border: 1px solid rgba(255,255,255,0.1);
  display: flex; gap: 2rem;
}
.v-item { display: flex; flex-direction: column; gap: 2px; }
.v-label { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; opacity: .6; }
.v-value { font-size: .9rem; font-weight: 600; }

/* ── CARD ── */
.card {
  background: var(--white); border-radius: 20px; padding: 2.5rem;
  box-shadow: 0 25px 60px rgba(0,0,0,.3), 0 8px 20px rgba(0,0,0,.15);
  position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--red), #ff4444, var(--red));
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}
@keyframes shimmer {
  0%  { background-position: -200% 0; }
  100%{ background-position:  200% 0; }
}

.card-title   { font-size: 1.25rem; font-weight: 700; color: var(--gray-800); margin-bottom: .4rem; }
.card-subtitle{ font-size: .85rem; color: var(--gray-600); margin-bottom: 2rem; line-height: 1.5; }

/* Central icon */
.lock-icon-wrapper { display: flex; justify-content: center; margin-bottom: 1.5rem; }
.lock-icon-bg {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, #fff0f0, #ffe0e0);
  border: 2px solid #ffcccc;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(204,0,0,.15);
  transition: all .4s ease;
}
.lock-icon-bg svg {
  width: 32px; height: 32px;
  fill: none; stroke: var(--red);
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke .4s;
}
.lock-icon-bg.state-shield { background: linear-gradient(135deg,#fff0f0,#ffe0e0); border-color:#ffcccc; }
.lock-icon-bg.state-shield svg { stroke: var(--red); }
.lock-icon-bg.state-loader { background: linear-gradient(135deg,#fff8e1,#fff3cc); border-color:#ffe082; }
.lock-icon-bg.state-loader svg { stroke: #e65100; }
.lock-icon-bg.state-done   { background: linear-gradient(135deg,#e8f5e9,#c8e6c9); border-color:#a5d6a7; }
.lock-icon-bg.state-done   svg { stroke: #2e7d32; }

/* Steps */
.steps-bar { display: flex; align-items: center; margin-bottom: 2rem; }
.step { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; }
.step:not(:last-child)::after {
  content: ''; position: absolute; top: 13px; left: 50%; right: -50%;
  height: 2px; background: var(--gray-200); z-index: 0;
}
.step.active:not(:last-child)::after,
.step.done:not(:last-child)::after { background: var(--red); }

.step-circle {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--gray-200); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 600; color: var(--gray-400);
  position: relative; z-index: 1; transition: all .3s ease;
}
.step-circle svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.step.done   .step-circle { background: var(--red); border-color: var(--red); color: var(--white); }
.step.active .step-circle { border-color: var(--red); color: var(--red); box-shadow: 0 0 0 4px rgba(204,0,0,.12); }
.step-label { font-size: .65rem; margin-top: 5px; color: var(--gray-400); font-weight: 500; white-space: nowrap; }
.step.active .step-label,
.step.done   .step-label { color: var(--red); }

/* PIN */
.pin-section { display: none; flex-direction: column; align-items: center; }
.pin-section.visible { display: flex; }
.pin-label { font-size: .88rem; color: var(--gray-600); margin-bottom: 1.2rem; text-align: center; }

/* Hidden native input */
.pin-native-input {
  position: absolute; opacity: 0; pointer-events: none;
  width: 1px; height: 1px; top: 0; left: 0;
  border: none; outline: none; font-size: 16px;
}

.pin-dots-area {
  display: flex; flex-direction: column; align-items: center;
  cursor: text; user-select: none; gap: 6px;
  padding: 8px 16px; border-radius: 12px;
  transition: background .2s;
  margin-bottom: 1rem;
}
.pin-dots-area:hover { background: rgba(204,0,0,.04); }
.pin-dots-area.focused { background: rgba(204,0,0,.06); }

.pin-tap-hint {
  font-size: .72rem; color: var(--gray-400); letter-spacing: .2px;
  display: none;
}
@media (hover: none) and (pointer: coarse) {
  .pin-tap-hint { display: block; }
}

.pin-dots { display: flex; gap: 16px; }
.pin-dot {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--gray-200); background: var(--white);
  transition: all .2s ease;
}
.pin-dot.filled { border-color: var(--red); background: var(--red); transform: scale(1.1); }
.pin-dots-area.focused .pin-dot:not(.filled) {
  border-color: var(--red); border-style: dashed;
}

@media (hover: none) and (pointer: coarse) {
  .numpad { display: none !important; }
}

.numpad {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 10px; width: 100%; max-width: 280px;
}
.numpad-btn {
  height: 56px;
  border: 2px solid var(--gray-200); border-radius: 12px;
  background: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 1.3rem; font-weight: 600; color: var(--gray-800);
  cursor: pointer; transition: all .15s ease;
  display: flex; align-items: center; justify-content: center;
  user-select: none;
}
.numpad-btn:hover        { border-color: var(--red); color: var(--red); background: #fff5f5; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(204,0,0,.15); }
.numpad-btn:active       { transform: scale(.94); box-shadow: none; }
.numpad-btn.empty        { border: none; background: transparent; cursor: default; pointer-events: none; }
.numpad-btn.delete       { color: var(--gray-600); }
.numpad-btn.delete svg   { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.numpad-btn.delete:hover { color: var(--red); border-color: var(--red); background: #fff5f5; }

/* Agree */
.agree-section { display: none; flex-direction: column; gap: 1rem; }
.agree-section.visible { display: flex; }

.info-box {
  background: #fffbf0; border: 1px solid #f0d58a;
  border-radius: 10px; padding: 14px 16px;
  font-size: .82rem; color: #5f4700; line-height: 1.6;
  display: flex; gap: 12px; align-items: flex-start;
}
.info-box .ib-icon { flex-shrink: 0; margin-top: 1px; }
.info-box .ib-icon svg { width: 18px; height: 18px; fill: none; stroke: #c68800; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.checkbox-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.checkbox-row input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--red);
  margin-top: 2px; cursor: pointer; flex-shrink: 0;
}
.checkbox-row span { font-size: .82rem; color: var(--gray-600); line-height: 1.5; }
.checkbox-row span a { color: var(--red); text-decoration: none; font-weight: 600; }

/* Button */
.btn-install {
  width: 100%; height: 52px; border-radius: 12px; border: none;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  color: var(--white); font-family: 'Inter', sans-serif;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  transition: all .2s ease;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  position: relative; overflow: hidden; letter-spacing: .5px;
}
.btn-install svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.btn-install::before {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg,transparent,rgba(255,255,255,.12),transparent);
  transition: left .4s ease;
}
.btn-install:hover::before { left: 100%; }
.btn-install:hover   { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(204,0,0,.4); }
.btn-install:active  { transform: translateY(0); box-shadow: none; }
.btn-install:disabled{ opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-install:disabled::before { display: none; }

/* Success */
.success-section { display: none; flex-direction: column; align-items: center; text-align: center; gap: 1rem; }
.success-section.visible { display: flex; }

.success-anim {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg,#e8f5e9,#c8e6c9);
  border: 2px solid #a5d6a7;
  display: flex; align-items: center; justify-content: center;
  animation: bounce-in .5s ease;
}
.success-anim.loading {
  background: linear-gradient(135deg,#fff8e1,#fff3cc);
  border-color: #ffe082;
}
.success-anim svg { width: 36px; height: 36px; fill: none; stroke: var(--green); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes bounce-in {
  0%  { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  100%{ transform: scale(1); opacity: 1; }
}

.success-title { font-size: 1.2rem; font-weight: 700; color: var(--green); }
.success-desc  { font-size: .85rem; color: var(--gray-600); line-height: 1.6; }

.progress-wrapper { width: 100%; }
.progress-bar-label { display: flex; justify-content: space-between; font-size: .78rem; color: var(--gray-600); margin-bottom: 6px; }
.progress-bar-track { width: 100%; height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden; }
.progress-bar-fill  { height: 100%; background: linear-gradient(90deg, var(--red), #e05050); border-radius: 4px; width: 0%; transition: width .05s linear; }

/* Error */
.error-msg {
  display: none; background: #ffebee; border: 1px solid #ffcdd2;
  border-radius: 8px; padding: 10px 14px;
  font-size: .82rem; color: #c62828; text-align: center; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.error-msg svg { width: 16px; height: 16px; fill: none; stroke: #c62828; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.error-msg.visible { display: flex; }

/* Footer */
.footer { text-align: center; padding: 2rem; color: rgba(255,255,255,.45); font-size: .75rem; }
.footer a { color: rgba(255,255,255,.65); text-decoration: none; }

.deco-circle {
  position: fixed; bottom: -200px; left: -100px;
  width: 450px; height: 450px; border-radius: 50%;
  background: rgba(255,255,255,.03); pointer-events: none; z-index: -1;
}

@media (max-width: 768px) {
  .main { grid-template-columns: 1fr; gap: 2rem; padding: 2rem 1.2rem; }
  .info-panel h1 { font-size: 1.8rem; }
  .card { padding: 2rem 1.5rem; }
}
