:root{
    --bg-1: #222230;           
    --bg-2: rgba(255,255,255,0.02);
    --glass: rgba(255,255,255,0.06);
    --glass-strong: rgba(255,255,255,0.10);
    --muted: rgba(255,255,255,0.65);
    --accent: #22c55e;         
    --accent-weak: rgba(34,197,94,0.12);
    --success: #16a34a;
    --radius: 16px;
    --glass-border: rgba(255,255,255,0.09);
    --glass-shadow: rgba(2,6,23,0.6);
    --glass-height: 92vh;
    font-synthesis: none;
  }

  *{box-sizing:border-box;margin:0;padding:0}
  html,body{height:100%}
  body{
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    background: var(--bg-1);
    color: #fff;
    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
    display:flex;
    align-items:center;
    justify-content:center;
  }

  /* ---------- Card / Glass Panel ---------- */
  .shell{
    width:100%;
    max-width:420px;
    padding:28px;
    overflow:hidden;
  }

  .glass {
    border-radius: var(--radius);
    padding:22px;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    border: 1px solid var(--glass-border);
    box-shadow: 0 6px 20px rgba(2,6,23,0.5), inset 0 1px 0 rgba(255,255,255,0.02);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    backdrop-filter: blur(8px) saturate(120%);
  }

  header{
    display:flex;
    align-items:center;
    gap:9px;
    margin-bottom:28px;
    text-align: left;
  }

  h1{
    font-size:18px;
    letter-spacing:0.2px;
    font-weight:700;
    color:#fff;
  }
  p.lead{
    margin-top:6px;
    color:var(--muted);
    font-size:13px;
    line-height:1.25;
  }

  /* ---------- Form ---------- */
  label{
    font-size:13px;color:var(--muted);display:block;margin-bottom:8px;
  }

  input[type="text"]{
    width:100%;
    padding:14px 16px;
    border-radius:12px;
    border:1px solid rgba(255,255,255,0.06);
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    color: #fff;
    font-size:15px;
    outline:none;
    transition: box-shadow .16s, border-color .16s, transform .08s;
  }
  input[type="text"]::placeholder{color: rgba(255,255,255,0.35)}
  input[type="text"]:focus{
    border-color: var(--accent);
    box-shadow: 0 6px 18px rgba(34,197,94,0.12), 0 0 0 6px var(--accent-weak);
    transform: translateY(-1px);
  }
  .radio-group {
    display: flex;
    gap: 20px;
    margin: 10px 0 20px;
    flex-wrap: wrap;
  }

  .radio-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 15px;
  }

  .radio-option input[type="radio"] {
    accent-color: var(--accent);
  }

  .row{display:flex;gap:12px;align-items:center}
  .muted { color:var(--muted); font-size:13px }

  /* CTA */
  .cta {
    margin-top:14px;
    display:flex;
    gap:12px;
    align-items:center;
  }

  .btn {
    flex:1;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:12px 16px;
    border-radius:12px;
    border:none;
    background: linear-gradient(180deg, var(--accent), #16a34a);
    color:#022; font-weight:700; font-size:15px;
    cursor:pointer;
    box-shadow: 0 8px 24px rgba(2,6,23,0.45), 0 2px 0 rgba(255,255,255,0.02) inset;
    transition: transform .08s, box-shadow .12s, opacity .12s;
  }
  .btn:active{ transform:translateY(1px) }
  .btn:disabled{ opacity:.6; cursor:not-allowed }

  .secondary {
    padding:10px 12px;
    border-radius:10px;
    background:transparent;
    border:1px solid rgba(255,255,255,0.04);
    color:var(--muted);
    font-size:13px;
  }

  /* ---------- OTP Screen ---------- */
  .otp-screen{
    display:none;
    margin-top:8px;
  }
  .show{ display:block }
  .otp-box{
    display:flex;
    gap:10px;
    justify-content:center;
    margin:18px 0 8px;
  }
  .otp-box input{
    width:64px;height:64px;border-radius:12px;
    text-align:center;font-size:22px;border:1px solid rgba(255,255,255,0.06);
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    color:#fff;outline:none;transition: box-shadow .12s, border-color .12s;
  }
  .otp-box input:focus{
    border-color:var(--accent);
    box-shadow: 0 8px 20px rgba(34,197,94,0.12), 0 0 0 6px var(--accent-weak);
  }
  .small {
    font-size:13px;color:var(--muted);text-align:center;margin-top:6px;
  }

  /* Footer link */
  .link {
    display:none; 
    margin-top:12px; text-align:center; color:var(--accent);
    text-decoration:none; font-weight:600; cursor:pointer;
  }

  .timer-text {
    display:block;
    margin-top:12px; text-align:center; color:var(--muted);
    font-size: 13px; font-variant-numeric: tabular-nums;
  }

  .turnstile-modal {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(2, 6, 23, 0.72);
    border-radius: 16px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .16s ease, visibility .16s ease;
  }

  .turnstile-modal.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .turnstile-dialog {
    position: relative;
    width: min(100%, 360px);
    padding: 24px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    background: #292938;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
    text-align: center;
  }

  .turnstile-dialog h2 {
    margin-bottom: 6px;
    font-size: 17px;
  }

  .turnstile-dialog .cf-turnstile {
    display: flex;
    justify-content: center;
    margin-top: 18px;
  }

  .turnstile-close {
    position: absolute;
    top: 8px;
    right: 10px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
  }


  /* ── Link Screen ─────────────────────────── */
  .link-screen {
    display: none;
    flex-direction: column;
    gap: 1.25rem;
  }

  .link-screen.show {
    display: flex;
  }

  .link-screen-icon {
    font-size: 2.5rem;
    color: var(--accent, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: color-mix(in srgb, var(--accent, #6366f1) 12%, transparent);
    border-radius: 14px;
  }

  /* Steps */
  .link-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .75rem;
  }

  .link-step {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    font-size: .875rem;
    line-height: 1.5;
  }

  .step-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent, #6366f1);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    display: grid;
    place-items: center;
  }

  /* Link copy row */
  .lscreen-link-box {
    background: var(--input-bg, #f5f5f5);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: .875rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
  }

  .lscreen-copy-row {
    display: flex;
    gap: .5rem;
    align-items: center;
  }

  .lscreen-link-input {
    flex: 1;
    font-size: .78rem;
    padding: .5rem .75rem;
    border-radius: 8px;
    border: 1px solid var(--border, #ccc);
    background: var(--surface, #fff);
    color: inherit;
    cursor: text;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .icon-btn {
    display: grid;
    place-items: center;
    padding: .5rem;
    font-size: 1.1rem;
    border-radius: 8px;
  }

  .copy-feedback {
    display: block;
    font-size: .75rem;
    color: var(--success, #22c55e);
    min-height: 1rem;
  }

  /* Open link button variant */
  .btn-outline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    background: transparent;
    border: 2px solid var(--accent, #6366f1);
    color: var(--accent, #6366f1);
    font-weight: 600;
    text-decoration: none;
  }

  .btn-outline:hover {
    background: color-mix(in srgb, var(--accent, #6366f1) 10%, transparent);
  }

  /* OTP verifying state */
  .otp-verifying {
    opacity: 0.55;
    pointer-events: none;
    filter: grayscale(1);
    transition: opacity .2s ease, filter .2s ease;
  }

  .otp-verifying .otp {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.08);
  }

  .otp-verifying .small,
  .otp-verifying .timer-text {
    color: rgba(255,255,255,0.45);
  }

  /* ---------- Inline Message ---------- */
  .form-msg{
    display:none;
    margin:14px 0px 14px 0px;
    padding:10px 14px;
    border-radius:10px;
    font-size:13px;
    line-height:1.35;
    background: rgba(239,68,68,0.12);
    color:#fecaca;
    border:1px solid rgba(239,68,68,0.25);
  }

  .form-msg.success{
    background: rgba(34,197,94,0.14);
    color:#bbf7d0;
    border-color: rgba(34,197,94,0.3);
  }

  .form-msg.show{
    display:block;
  }

  /* ---------- SUCCESS SCREEN ---------- */
  .success-screen{
    display:none;
    text-align:center;
    animation: fadeIn .35s ease;
  }

  .success-screen.show{
    display:block;
  }

  .success-icon{
    width:64px;
    height:64px;
    margin:0 auto 14px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
  }

  .success-icon ion-icon{
    font-size:34px;
    color: #22c55e;
  }

  @keyframes fadeIn{
    from{ opacity:0; transform: translateY(6px) }
    to{ opacity:1; transform:none }
  }

  /* Responsive tweaks */
  @media screen and (max-width: 768px){
    .shell{ padding:18px; max-width: 100%; width:100% }
    .glass{ padding:16px }
    .logo{ width:44px;height:44px }
    .otp-box input{ width:54px;height:54px }
  }