:root {
    /* High-end Professional Dark Palette (Linear/Vercel inspired) */
    --bg-base: #000000;
    --bg-surface: #09090b;
    --bg-surface-hover: #18181b;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --primary: #ffffff;
    --primary-invert: #000000;
    --accent: #3b82f6; /* Trust blue */
    --accent-glow: rgba(59, 130, 246, 0.5);
    
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-tertiary: #52525b;
    
    --error: #ef4444;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    line-height: 1.5;
}

/* --- Animated Spotlight Background --- */
.background-fx {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-base);
    pointer-events: none;
}

/* Moving Spotlight */
.background-fx::before {
    content: '';
    position: absolute;
    width: 150vw;
    height: 150vh;
    top: -25vh;
    left: -25vw;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.03) 0%, transparent 60%);
    animation: spotlightPan 20s ease-in-out infinite alternate;
}

@keyframes spotlightPan {
    0% { transform: translate(-5%, -5%); }
    100% { transform: translate(5%, 5%); }
}

/* Subtle Animated Background Text */
.bg-brand-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18vw;
    font-weight: 900;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.02);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    white-space: nowrap;
    z-index: -1;
    user-select: none;
    animation: textBreathe 8s ease-in-out infinite alternate;
}

@keyframes textBreathe {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1.02); opacity: 1; }
}

/* --- Layout Container --- */
.container {
    width: 100%;
    max-width: 500px;
    padding: 10vh 1.5rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    position: relative;
    z-index: 1;
}

/* --- Typography & Animations --- */
.hero {
    text-align: center;
    animation: fadeSlideDown 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    margin-bottom: 1rem;
    background: linear-gradient(180deg, #FFFFFF 0%, #A1A1AA 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 80%;
    margin: 0 auto;
}

/* --- The Professional Card --- */
.pro-card {
    background: linear-gradient(180deg, rgba(24, 24, 27, 0.4) 0%, rgba(9, 9, 11, 0.4) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    position: relative;
    overflow: hidden;
    
    /* Reveal Animation */
    opacity: 0;
    transform: translateY(20px);
    animation: fadeSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

/* Elegant Top Glow on Card */
.pro-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    opacity: 0.5;
    transition: opacity 0.5s ease;
}

.pro-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.9), 0 0 40px -10px rgba(255,255,255,0.03);
}

.pro-card:hover::before {
    opacity: 1;
}

/* --- Input Field --- */
input[type="text"], input[type="url"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.125rem 1.25rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

input:focus {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(0,0,0,0.8);
    box-shadow: 
        inset 0 2px 4px rgba(0,0,0,0.5),
        0 0 0 3px rgba(255, 255, 255, 0.05);
}

input::placeholder {
    color: var(--text-tertiary);
}

/* --- Beautiful Button --- */
.primary-btn {
    background: var(--primary);
    color: var(--primary-invert);
    border: none;
    border-radius: 12px;
    padding: 1.125rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.primary-btn::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    transform: skewX(-20deg);
    transition: 0s;
}

.primary-btn:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(255,255,255,0.2);
}

.primary-btn:hover:not(:disabled)::after {
    left: 200%;
    transition: 0.6s ease-in-out;
}

.primary-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-surface-hover);
    color: var(--text-secondary);
}

/* Download Button Variation */
.download-btn {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.download-btn:hover:not(:disabled) {
    background: var(--bg-surface-hover);
    border-color: var(--border-hover);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* --- Status & Results Animations --- */
.result-container {
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Scale and Fade reveal */
    animation: scaleFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.qr-wrapper {
    background-color: #ffffff;
    padding: 1.25rem;
    border-radius: 16px;
    display: inline-block;
    margin-bottom: 2rem;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    /* Subtle hover float on QR code */
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.qr-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 45px rgba(0,0,0,0.6);
}

#qr-image {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

/* --- Loader --- */
.loading {
    margin-top: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.spinner {
    border: 2px solid var(--border-subtle);
    border-radius: 50%;
    border-top: 2px solid var(--primary);
    width: 24px;
    height: 24px;
    margin: 0 auto 1rem;
    animation: spin 0.8s cubic-bezier(0.6, 0.1, 0.4, 0.9) infinite;
}

/* --- Utilities & Keyframes --- */
.error-message {
    margin-top: 1.5rem;
    color: var(--error);
    font-size: 0.9rem;
    background-color: rgba(239, 68, 68, 0.1);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(239, 68, 68, 0.2);
    animation: slideShake 0.4s ease;
}

[hidden] {
    display: none !important;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeSlideDown {
    0% { opacity: 0; transform: translateY(-20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes scaleFadeIn {
    0% { opacity: 0; transform: scale(0.95) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes slideShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .container { padding: 8vh 1rem 3rem; }
    .hero h1 { font-size: 2.25rem; }
    .pro-card { padding: 1.5rem; border-radius: 16px; }
    .bg-brand-text { font-size: 24vw; }
}
