/* ========================================
   GetFiles Code Redirect — Premium Dark UI
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ---- CSS Variables ---- */
:root {
    --bg-primary: #0a0a0f;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --bg-input: rgba(255, 255, 255, 0.06);
    --bg-input-focus: rgba(255, 255, 255, 0.10);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(139, 92, 246, 0.5);
    --text-primary: #f0f0f5;
    --text-secondary: #8b8b9e;
    --text-muted: #55556a;
    --accent-purple: #8b5cf6;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;
    --gradient-main: linear-gradient(135deg, #8b5cf6, #3b82f6, #06b6d4);
    --gradient-glow: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(59, 130, 246, 0.15), rgba(6, 182, 212, 0.15));
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

/* ---- Animated Background ---- */
.bg-aurora {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-aurora::before,
.bg-aurora::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    animation: auroraFloat 12s ease-in-out infinite alternate;
}

.bg-aurora::before {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.35), transparent 70%);
    top: -15%;
    left: -10%;
}

.bg-aurora::after {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.3), transparent 70%);
    bottom: -15%;
    right: -10%;
    animation-delay: -6s;
    animation-direction: alternate-reverse;
}

.bg-aurora-extra {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.25;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.3), transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: auroraFloat 15s ease-in-out infinite alternate-reverse;
    animation-delay: -3s;
}

@keyframes auroraFloat {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(40px, -30px) scale(1.05); }
    66%  { transform: translate(-20px, 20px) scale(0.95); }
    100% { transform: translate(30px, -10px) scale(1.02); }
}

/* Grid noise overlay */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

/* ---- Main Container ---- */
.main-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    padding: 20px;
}

/* ---- Card ---- */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(40px) saturate(1.5);
    -webkit-backdrop-filter: blur(40px) saturate(1.5);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transition: var(--transition-normal);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.5), rgba(6, 182, 212, 0.5), transparent);
}

/* ---- Logo / Brand ---- */
.brand {
    text-align: center;
    margin-bottom: 40px;
}

.brand-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: var(--radius-lg);
    background: var(--gradient-glow);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: iconPulse 3s ease-in-out infinite;
}

.brand-icon svg {
    width: 32px;
    height: 32px;
    color: var(--accent-purple);
}

@keyframes iconPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.2); }
    50%      { box-shadow: 0 0 20px 5px rgba(139, 92, 246, 0.1); }
}

.brand h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.brand p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ---- Code Input Group ---- */
.code-input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 32px;
}

.code-input {
    width: 56px;
    height: 68px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    outline: none;
    caret-color: var(--accent-purple);
    transition: var(--transition-fast);
    -moz-appearance: textfield;
}

.code-input::-webkit-outer-spin-button,
.code-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.code-input:focus {
    background: var(--bg-input-focus);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15), 0 0 20px rgba(139, 92, 246, 0.1);
    transform: translateY(-2px);
}

.code-input.filled {
    border-color: rgba(139, 92, 246, 0.35);
    background: rgba(139, 92, 246, 0.08);
}

.code-input.error {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.08);
    animation: inputShake 0.4s ease-in-out;
}

.code-input.success {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.08);
}

@keyframes inputShake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

/* ---- Submit Button ---- */
.btn-submit {
    width: 100%;
    padding: 16px 24px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #fff;
    background: var(--gradient-main);
    background-size: 200% 200%;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.35);
    background-position: right center;
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-submit .btn-icon {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-fast);
}

.btn-submit:hover:not(:disabled) .btn-icon {
    transform: translateX(3px);
}

/* Loading spinner inside button */
.btn-submit .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ---- Status Message ---- */
.status-message {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transform: translateY(8px);
    transition: var(--transition-normal);
    display: none;
}

.status-message.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeSlideIn 0.3s ease-out;
}

.status-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.status-message.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.status-message.info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

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

/* ---- Redirect Overlay ---- */
.redirect-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-smooth);
}

.redirect-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.redirect-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(139, 92, 246, 0.15);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 24px;
}

.redirect-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.redirect-text span {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* ---- Footer ---- */
.footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer a:hover {
    color: var(--accent-purple);
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .card {
        padding: 36px 24px;
        border-radius: var(--radius-lg);
    }

    .code-input-group {
        gap: 8px;
    }

    .code-input {
        width: 46px;
        height: 58px;
        font-size: 1.25rem;
        border-radius: var(--radius-sm);
    }

    .brand h1 {
        font-size: 1.35rem;
    }

    .brand-icon {
        width: 52px;
        height: 52px;
    }

    .brand-icon svg {
        width: 26px;
        height: 26px;
    }
}

@media (max-width: 360px) {
    .code-input {
        width: 40px;
        height: 52px;
        font-size: 1.1rem;
    }
    
    .code-input-group {
        gap: 6px;
    }
}
