:root {
    --bg-dark: #0a0a0f;
    --card-bg: rgba(20, 20, 30, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary: #8a2be2; /* Neon Violet */
    --primary-hover: #9d4edd;
    --primary-glow: rgba(138, 43, 226, 0.4);
    --success: #00f5ff; /* Cyan glow */
    --success-bg: rgba(0, 245, 255, 0.1);
    --warning: #ffb703;
    --warning-bg: rgba(255, 183, 3, 0.1);
    --error: #ff003c;
    --error-bg: rgba(255, 0, 60, 0.1);
    --text-main: #f8f9fa;
    --text-muted: #adb5bd;
    --font-main: 'Outfit', sans-serif;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Dynamic Background Orbs */
.background-effects {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

.orb-1 {
    width: 300px; height: 300px;
    background: var(--primary);
    top: -100px; left: -100px;
}

.orb-2 {
    width: 400px; height: 400px;
    background: #00f5ff;
    bottom: -150px; right: -150px;
    animation-delay: -5s;
    opacity: 0.3;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.2); }
}

/* Layout */
.container {
    width: 100%;
    max-width: 480px; /* Mobile-first opt */
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Header */
.header {
    text-align: center;
}

.logo {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo span {
    color: var(--primary);
    -webkit-text-fill-color: var(--primary);
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 300;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.scanner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.scanner-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.status-indicator {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 var(--primary-glow); }
    70% { box-shadow: 0 0 0 10px rgba(138,43,226, 0); }
    100% { box-shadow: 0 0 0 0 rgba(138,43,226, 0); }
}

.instruction {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 24px;
}

/* Forms and Inputs */
.verify-form {
    display: flex;
    flex-direction: column;
}

.input-group {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

input[type="text"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Buttons */
.btn-primary {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: var(--transition);
}

.btn-primary:hover::before {
    left: 100%;
    transition: 0.7s;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 8px 16px var(--primary-glow);
    transform: translateY(-1px);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    margin-top: 12px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    position: absolute;
}

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

.hidden {
    display: none !important;
}

/* Results section */
.result-container {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--card-border);
    text-align: center;
    animation: fadeIn 0.4s ease-out forwards;
}

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

.status-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}

.status-icon svg {
    width: 32px; height: 32px;
}

.result-container h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.result-container p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.result-details {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 16px;
    text-align: left;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    border-bottom: 1px dashed rgba(255,255,255,0.1);
    padding-bottom: 8px;
}
.detail-row:last-child {
    margin-bottom: 0; border-bottom: none; padding-bottom: 0;
}
.detail-label { font-weight: 600; color: #fff; }

/* Status Classes applied by JS */
.status-success .status-icon { background: var(--success-bg); color: var(--success); box-shadow: 0 0 20px rgba(0, 245, 255, 0.2); }
.status-success h3 { color: var(--success); }

.status-warning .status-icon { background: var(--warning-bg); color: var(--warning); box-shadow: 0 0 20px rgba(255, 183, 3, 0.2); }
.status-warning h3 { color: var(--warning); }

.status-error .status-icon { background: var(--error-bg); color: var(--error); box-shadow: 0 0 20px rgba(255, 0, 60, 0.2); }
.status-error h3 { color: var(--error); }

/* Test controls */
.test-controls {
    padding: 24px;
}
.test-controls h3 { margin-bottom: 8px; font-size: 1.1rem; }
.test-controls p { font-size: 0.85rem; color: var(--text-muted); }
.generate-result { margin-top: 12px; font-family: monospace; color: var(--success); font-weight: 600; position:relative;}

/* Media Queries */
@media (min-width: 768px) {
    .container {
        padding: 40px;
    }
    .input-group {
        flex-direction: row;
    }
    input[type="text"] {
        flex: 1;
    }
    .btn-primary {
        width: auto;
        padding: 16px 32px;
    }
}
