:root {
    --bg: #05060f;
    --panel: rgba(15, 17, 32, 0.75);
    --border: rgba(0, 240, 255, 0.25);
    --cyan: #00f0ff;
    --violet: #a855f7;
    --pink: #ff2e9a;
    --text: #e6f1ff;
    --muted: #7b87a8;
    --danger: #ff5d7a;
}

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

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: 'Rajdhani', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* --- Cinematic Background --- */
.bg-glow {
    position: fixed;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
    z-index: 0;
    animation: float 12s ease-in-out infinite;
}
.bg-glow-1 { background: var(--cyan); top: -20%; left: -15%; }
.bg-glow-2 { background: var(--violet); bottom: -25%; right: -15%; animation-delay: -6s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(4%, 5%) scale(1.1); }
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.06) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
    z-index: 0;
}

/* --- Layout --- */
.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 24px;
}

.brand { text-align: center; margin-bottom: 28px; }

.logo-ring {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 50%;
    border: 2px solid var(--cyan);
    box-shadow: 0 0 20px var(--cyan), inset 0 0 15px rgba(0, 240, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 24px;
    color: var(--cyan);
    animation: pulse-ring 3s ease-in-out infinite;
}
@keyframes pulse-ring {
    0%, 100% { box-shadow: 0 0 20px var(--cyan), inset 0 0 15px rgba(0, 240, 255, 0.3); }
    50% { box-shadow: 0 0 32px var(--cyan), inset 0 0 22px rgba(0, 240, 255, 0.5); }
}

.brand h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 28px;
    letter-spacing: 1px;
    font-weight: 700;
}
.brand h1 span {
    background: linear-gradient(90deg, var(--cyan), var(--violet), var(--pink));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.tagline { color: var(--muted); font-size: 15px; margin-top: 6px; }

/* --- Card --- */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    backdrop-filter: blur(16px);
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.08), 0 20px 60px rgba(0,0,0,0.5);
}

label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

input[type="tel"] {
    width: 100%;
    padding: 13px 14px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    letter-spacing: 1px;
    margin-bottom: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="tel"]:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 12px rgba(0,240,255,0.25);
}

.btn-primary {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--cyan), var(--violet));
    color: #05060f;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0,240,255,0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 30px rgba(0,240,255,0.55); }
.btn-primary:active { transform: translateY(0); }

/* --- Result Area --- */
.result {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.result.hidden { display: none; }

.spinner {
    width: 40px;
    height: 40px;
    margin: 6px auto 14px;
    border: 3px solid rgba(0,240,255,0.15);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
.spinner.hidden { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.code-display {
    font-family: 'Orbitron', sans-serif;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--cyan);
    text-shadow: 0 0 18px var(--cyan);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(0,240,255,0.05);
}
.code-display.hidden { display: none; }

.status-text { color: var(--text); font-size: 15px; line-height: 1.5; }

footer {
    text-align: center;
    margin-top: 22px;
    color: var(--muted);
    font-size: 13px;
}

.hidden { display: none; }

@media (max-width: 420px) {
    .container { padding: 16px; }
    .brand h1 { font-size: 24px; }
}

.diagnostic {
    margin-top: 16px;
    padding: 14px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.45);
    color: #8ff0c8;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.6;
    text-align: left;
    white-space: pre-wrap;
    overflow-x: auto;
}


/* --- Enhanced visual polish (keeps the original pairing functionality intact) --- */
:root {
    --bg: #050611;
    --panel: rgba(12, 16, 33, 0.78);
    --border: rgba(0, 240, 255, 0.24);
}

html { min-height: 100%; scroll-behavior: smooth; }

body {
    padding: 28px 0;
    background:
        radial-gradient(ellipse at 50% 5%, rgba(24, 40, 82, 0.42), transparent 44%),
        linear-gradient(145deg, #050611 0%, #080918 48%, #090513 100%);
}

.bg-glow {
    width: min(68vw, 680px);
    height: min(68vw, 680px);
    filter: blur(110px);
    opacity: .22;
    pointer-events: none;
}
.bg-glow-1 { background: #00d9ff; }
.bg-glow-2 { background: #873bff; }

.bg-grid {
    opacity: .62;
    background-size: 34px 34px;
}

.container {
    max-width: 470px;
    padding: 28px 22px;
}

.brand {
    margin-bottom: 30px;
    animation: rise-in .7s ease both;
}

.logo-ring {
    width: 74px;
    height: 74px;
    margin-bottom: 17px;
    border-color: rgba(0, 240, 255, .8);
    background: linear-gradient(145deg, rgba(0, 240, 255, .12), rgba(168, 85, 247, .08));
    box-shadow: 0 0 32px rgba(0, 240, 255, .18), inset 0 0 22px rgba(0, 240, 255, .09);
}

.brand h1 {
    font-size: clamp(27px, 7vw, 34px);
    letter-spacing: 1.4px;
    text-shadow: 0 0 30px rgba(0, 240, 255, .1);
}

.tagline {
    font-size: 16px;
    letter-spacing: .35px;
}

.card {
    position: relative;
    overflow: hidden;
    padding: clamp(21px, 5vw, 28px);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(17, 22, 44, .92), rgba(8, 10, 24, .9));
    border: 1px solid rgba(93, 224, 255, .23);
    box-shadow: 0 18px 65px rgba(0, 0, 0, .38), 0 0 34px rgba(0, 240, 255, .07);
    animation: rise-in .8s .08s ease both;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, .75), rgba(168, 85, 247, .75), transparent);
}

label {
    font-size: 14px;
    font-weight: 600;
    color: #aab8d6;
}

input[type="tel"] {
    padding: 15px 16px;
    border-radius: 12px;
    background: rgba(2, 5, 17, .7);
    border-color: rgba(123, 151, 198, .25);
    font-size: 17px;
}
input[type="tel"]::placeholder { color: #66718f; }
input[type="tel"]:focus {
    border-color: rgba(0, 240, 255, .75);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, .08), 0 0 22px rgba(0, 240, 255, .12);
}

.btn-primary {
    position: relative;
    min-height: 50px;
    padding: 15px;
    border-radius: 12px;
    background: linear-gradient(105deg, #00e6f5 0%, #6d7cff 55%, #a855f7 100%);
    color: #050611;
    box-shadow: 0 8px 26px rgba(0, 210, 255, .18);
}
.btn-primary:hover {
    box-shadow: 0 10px 32px rgba(0, 210, 255, .3);
}
.btn-primary:disabled {
    opacity: .62;
    cursor: wait;
    transform: none;
}

.result {
    border-top-color: rgba(0, 240, 255, .17);
}
.code-display {
    overflow-wrap: anywhere;
    font-size: clamp(22px, 7vw, 30px);
    background: linear-gradient(135deg, rgba(0, 240, 255, .09), rgba(168, 85, 247, .09));
    border-color: rgba(0, 240, 255, .3);
}

.status-text {
    color: #d9e5ff;
    overflow-wrap: anywhere;
}
.status-text strong { color: #70f7d2; }

footer {
    margin: 20px 4px 0;
    padding: 13px 15px;
    border: 1px solid rgba(125, 146, 194, .13);
    border-radius: 13px;
    background: rgba(10, 13, 29, .52);
    font-size: 13px;
    line-height: 1.55;
    color: #98a5c4;
}

.maleemahi-credit {
    margin: 28px auto 2px;
    padding: 18px 12px 8px;
    text-align: center;
    position: relative;
    animation: rise-in .8s .16s ease both;
}

.credit-line {
    display: block;
    width: 76px;
    height: 2px;
    margin: 0 auto 17px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--cyan), var(--violet), var(--pink));
    box-shadow: 0 0 18px rgba(0, 240, 255, .28);
}

.credit-eyebrow {
    margin-bottom: 7px;
    color: #7786a9;
    font-family: 'Orbitron', sans-serif;
    font-size: 9px;
    letter-spacing: 3px;
}

.maleemahi-credit h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(22px, 6vw, 27px);
    font-weight: 900;
    letter-spacing: 1.5px;
    color: #f0f5ff;
    text-shadow: 0 0 22px rgba(0, 240, 255, .12);
}

.maleemahi-credit h2 span {
    margin-left: 5px;
    background: linear-gradient(95deg, #00efff, #9c73ff 58%, #ff63bd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.credit-caption {
    margin-top: 7px;
    color: #7f8bab;
    font-size: 14px;
    letter-spacing: .45px;
}

.credit-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 15px;
    padding: 7px 11px;
    border: 1px solid rgba(0, 240, 255, .17);
    border-radius: 99px;
    background: rgba(0, 240, 255, .045);
    color: #9aa9ca;
    font-family: 'Orbitron', sans-serif;
    font-size: 8px;
    letter-spacing: 1.4px;
}

.credit-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #61f5d1;
    box-shadow: 0 0 9px rgba(97, 245, 209, .8);
}

@keyframes rise-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 420px) {
    body { padding: 14px 0; }
    .container { padding: 16px; }
    .brand { margin-bottom: 24px; }
    .card { padding: 20px; }
    footer { font-size: 12px; }
}
