@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: #0a0a0f;
    color: #e0e0e0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── Animated BG ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(124,92,252,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(88,60,220,0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(140,100,255,0.04) 0%, transparent 50%);
    animation: bgShift 12s ease-in-out infinite alternate;
    z-index: -1;
    pointer-events: none;
}
@keyframes bgShift {
    0% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0.7; transform: scale(1); }
}

/* Subtle grid pattern */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(124,92,252,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124,92,252,0.015) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: -1;
    pointer-events: none;
}

/* ── Login ── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-box {
    background: rgba(18,18,26,0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(124,92,252,0.15);
    border-radius: 16px;
    padding: 44px 40px;
    width: 380px;
    box-shadow:
        0 20px 60px rgba(0,0,0,0.4),
        0 0 40px rgba(124,92,252,0.05),
        inset 0 1px 0 rgba(255,255,255,0.03);
    transition: box-shadow 0.4s ease;
}
.login-box:hover {
    box-shadow:
        0 20px 60px rgba(0,0,0,0.4),
        0 0 60px rgba(124,92,252,0.08),
        inset 0 1px 0 rgba(255,255,255,0.03);
}

.login-header { text-align: center; margin-bottom: 32px; }
.login-header h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 3px;
    color: #7c5cfc;
    text-shadow: 0 0 30px rgba(124,92,252,0.3);
}
.login-header p { color: #555; margin-top: 6px; font-size: 13px; letter-spacing: 1px; }

.input-group { margin-bottom: 20px; }
.input-group label {
    display: block; font-size: 11px; color: #666; margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600;
}
.input-group input {
    width: 100%; padding: 12px 14px;
    background: rgba(26,26,40,0.8); border: 1px solid #2a2a3a;
    border-radius: 8px; color: #e0e0e0; font-size: 14px; font-family: inherit;
    outline: none; transition: all 0.3s ease;
}
.input-group input:focus {
    border-color: #7c5cfc;
    box-shadow: 0 0 0 3px rgba(124,92,252,0.12), 0 0 20px rgba(124,92,252,0.05);
}

.btn-login {
    width: 100%; padding: 13px; margin-top: 10px;
    background: linear-gradient(135deg, #7c5cfc 0%, #5c3cdc 100%);
    color: #fff; border: none; border-radius: 10px;
    font-size: 15px; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(124,92,252,0.2);
    position: relative; overflow: hidden;
}
.btn-login::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0; transition: opacity 0.3s;
}
.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 30px rgba(124,92,252,0.3);
}
.btn-login:hover::after { opacity: 1; }
.btn-login:active { transform: translateY(0) scale(0.98); }

/* ── Topbar ── */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 28px;
    background: rgba(18,18,26,0.7);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(124,92,252,0.1);
    position: sticky; top: 0; z-index: 100;
}
.topbar::after {
    content: '';
    position: absolute; bottom: -1px; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent 0%, #7c5cfc 20%, #a78bfa 50%, #7c5cfc 80%, transparent 100%);
    background-size: 200% 100%;
    animation: neonSlide 8s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(124,92,252,0.5), 0 0 20px rgba(124,92,252,0.3);
}
@keyframes neonSlide {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.topbar-brand {
    font-size: 18px; font-weight: 800; letter-spacing: 2px;
    color: #7c5cfc; cursor: pointer; user-select: none;
    text-shadow: 0 0 20px rgba(124,92,252,0.4), 0 0 40px rgba(124,92,252,0.15);
    transition: all 0.3s ease;
    animation: brandPulse 3s ease-in-out infinite;
}
@keyframes brandPulse {
    0%,100% { text-shadow: 0 0 20px rgba(124,92,252,0.3), 0 0 40px rgba(124,92,252,0.1); }
    50% { text-shadow: 0 0 30px rgba(124,92,252,0.5), 0 0 60px rgba(124,92,252,0.2); }
}
.topbar-brand:hover {
    text-shadow: 0 0 40px rgba(124,92,252,0.6), 0 0 80px rgba(124,92,252,0.3);
    transform: scale(1.03);
}
/* Tab nav */
.tab-nav { display: flex; gap: 4px; }
.tab-btn {
    padding: 6px 18px; font-size: 12px; font-weight: 600; font-family: inherit;
    background: transparent; border: 1px solid transparent; border-radius: 6px;
    color: #666; cursor: pointer; transition: all 0.25s ease;
}
.tab-btn:hover { color: #aaa; background: rgba(124,92,252,0.04); }
.tab-btn.active {
    color: #7c5cfc; background: rgba(124,92,252,0.08);
    border-color: rgba(124,92,252,0.2);
    box-shadow: 0 0 12px rgba(124,92,252,0.06);
}

.btn-logout {
    color: #666; text-decoration: none; font-size: 13px;
    padding: 7px 18px; border: 1px solid #2a2a3a;
    border-radius: 8px; transition: all 0.3s ease;
}
.btn-logout:hover {
    color: #e0e0e0; border-color: #444;
    box-shadow: 0 0 15px rgba(255,255,255,0.03);
}

/* ── Container ── */
.container { max-width: 700px; margin: 36px auto; padding: 0 20px; }

.card {
    background: rgba(18,18,26,0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(124,92,252,0.1);
    border-radius: 14px;
    padding: 32px;
    transition: all 0.4s ease;
    box-shadow: 0 4px 30px rgba(0,0,0,0.2), 0 0 0 0 rgba(124,92,252,0);
    position: relative;
}
.card:hover {
    border-color: rgba(124,92,252,0.25);
    box-shadow: 0 4px 30px rgba(0,0,0,0.2), 0 0 30px rgba(124,92,252,0.06);
}
.card h2 { font-size: 18px; margin-bottom: 24px; color: #bbb; font-weight: 600; }

/* ── Form ── */
.form-section { margin-bottom: 24px; }
.form-section > label {
    display: block; font-size: 11px; color: #666;
    text-transform: uppercase; letter-spacing: 1.5px;
    margin-bottom: 10px; font-weight: 600;
}

/* Text input field */
.input-field {
    width: 100%; padding: 12px 14px;
    background: rgba(26,26,40,0.6); border: 1px solid #2a2a3a;
    border-radius: 8px; color: #e0e0e0; font-size: 13px; font-family: inherit;
    outline: none; transition: all 0.3s ease;
}
.input-field::placeholder { color: #444; }
.input-field:focus {
    border-color: #7c5cfc;
    box-shadow: 0 0 0 3px rgba(124,92,252,0.1), 0 0 15px rgba(124,92,252,0.05);
}

/* File upload */
.file-upload {
    position: relative; border: 2px dashed #2a2a3a;
    border-radius: 12px; padding: 32px; text-align: center;
    cursor: pointer; transition: all 0.35s ease;
}
.file-upload:hover, .file-upload.dragover {
    border-color: #7c5cfc;
    background: rgba(124,92,252,0.04);
    box-shadow: 0 0 30px rgba(124,92,252,0.08), inset 0 0 20px rgba(124,92,252,0.02);
}
.file-upload.has-file {
    border-color: #4caf50; border-style: solid;
    box-shadow: 0 0 20px rgba(76,175,80,0.1);
    animation: neonGreen 2s ease-in-out infinite;
}
@keyframes neonGreen {
    0%,100% { box-shadow: 0 0 15px rgba(76,175,80,0.08); }
    50% { box-shadow: 0 0 25px rgba(76,175,80,0.15); }
}
.file-upload input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-upload-text { color: #555; font-size: 14px; pointer-events: none; transition: color 0.3s; }
.file-upload.has-file .file-upload-text { color: #4caf50; }

/* Radio cards */
.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-card {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; background: rgba(26,26,40,0.6);
    border: 1px solid #2a2a3a; border-radius: 10px;
    cursor: pointer; transition: all 0.3s ease;
}
.radio-card:hover {
    border-color: #3a3a4a;
    background: rgba(26,26,40,0.8);
    transform: translateX(2px);
}
.radio-card:has(input:checked) {
    border-color: rgba(124,92,252,0.5);
    background: rgba(124,92,252,0.06);
    box-shadow: 0 0 20px rgba(124,92,252,0.08), inset 0 0 20px rgba(124,92,252,0.03);
    animation: neonCardPulse 2.5s ease-in-out infinite;
}
@keyframes neonCardPulse {
    0%,100% { box-shadow: 0 0 15px rgba(124,92,252,0.06), inset 0 0 15px rgba(124,92,252,0.02); }
    50% { box-shadow: 0 0 25px rgba(124,92,252,0.12), inset 0 0 25px rgba(124,92,252,0.04); }
}
.radio-card input[type="radio"] { accent-color: #7c5cfc; width: 16px; height: 16px; }
.radio-title { font-size: 14px; font-weight: 600; }
.radio-desc { font-size: 12px; color: #555; margin-top: 2px; transition: color 0.3s; }
.radio-card:has(input:checked) .radio-desc { color: #777; }

/* Checkboxes */
.checkbox-group { display: flex; flex-direction: column; gap: 6px; }
.checkbox-item {
    display: flex; align-items: center; gap: 12px;
    font-size: 13px; color: #999; cursor: pointer; transition: all 0.25s;
    padding: 10px 14px; border-radius: 8px;
    background: rgba(26,26,40,0.5); border: 1px solid transparent;
}
.checkbox-item:hover { color: #ccc; background: rgba(26,26,40,0.8); border-color: #2a2a3a; }
.checkbox-item input[type="checkbox"] { display: none; }
.checkbox-item::before {
    content: '';
    width: 18px; height: 18px; flex-shrink: 0;
    border: 1.5px solid #3a3a4a; border-radius: 5px;
    background: rgba(20,20,30,0.6);
    transition: all 0.25s ease;
    display: flex; align-items: center; justify-content: center;
}
.checkbox-item:has(input:checked)::before {
    background: #7c5cfc; border-color: #7c5cfc;
    box-shadow: 0 0 10px rgba(124,92,252,0.3);
}
.checkbox-item:has(input:checked)::before {
    content: '✓'; font-size: 12px; color: #fff;
    display: flex; align-items: center; justify-content: center; line-height: 1;
}
.checkbox-item:has(input:checked) { color: #ddd; border-color: rgba(124,92,252,0.15); background: rgba(124,92,252,0.04); }

/* Build button */
.btn-build {
    width: 100%; padding: 14px;
    background: linear-gradient(135deg, #7c5cfc 0%, #5c3cdc 100%);
    color: #fff; border: none; border-radius: 10px;
    font-size: 15px; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: all 0.3s ease;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 4px 20px rgba(124,92,252,0.2);
    position: relative; overflow: hidden;
}
.btn-build::before {
    content: '';
    position: absolute; top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    opacity: 0; transition: opacity 0.4s;
}
.btn-build {
    animation: btnGlow 3s ease-in-out infinite;
}
@keyframes btnGlow {
    0%,100% { box-shadow: 0 4px 20px rgba(124,92,252,0.2); }
    50% { box-shadow: 0 4px 30px rgba(124,92,252,0.35); }
}
.btn-build:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 35px rgba(124,92,252,0.4);
    animation: none;
}
.btn-build:hover::before { opacity: 1; }
.btn-build:active { transform: translateY(0) scale(0.98); }
.btn-build:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.spinner {
    width: 18px; height: 18px;
    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); } }

/* ── Result ── */
.result-box {
    margin-top: 20px; padding: 18px;
    background: rgba(76,175,80,0.06);
    border: 1px solid rgba(76,175,80,0.15);
    border-radius: 10px;
    box-shadow: 0 0 25px rgba(76,175,80,0.05);
    animation: fadeIn 0.4s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.result-link-row { display: flex; gap: 8px; align-items: center; }
.result-url {
    flex: 1; padding: 10px 12px; font-size: 13px;
    font-family: 'Consolas', 'SF Mono', monospace;
    background: rgba(26,26,40,0.8); border: 1px solid #2a2a3a;
    border-radius: 8px; color: #7c5cfc; outline: none;
    transition: border-color 0.3s;
}
.result-url:focus { border-color: #7c5cfc; }

.btn-copy {
    padding: 10px 18px; font-size: 13px; font-weight: 600; font-family: inherit;
    background: linear-gradient(135deg, #7c5cfc, #5c3cdc);
    color: #fff; border: none; border-radius: 8px;
    cursor: pointer; white-space: nowrap; transition: all 0.3s ease;
    box-shadow: 0 2px 12px rgba(124,92,252,0.2);
}
.btn-copy:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(124,92,252,0.3); }
.btn-copy:active { transform: scale(0.96); }

.btn-download {
    padding: 10px 18px; font-size: 13px; font-weight: 600;
    color: #4caf50; border: 1px solid rgba(76,175,80,0.25);
    border-radius: 8px; text-decoration: none; white-space: nowrap;
    transition: all 0.3s ease;
}
.btn-download:hover {
    background: rgba(76,175,80,0.08);
    box-shadow: 0 0 15px rgba(76,175,80,0.1);
    transform: translateY(-1px);
}

.result-meta { margin-top: 10px; font-size: 12px; color: #555; }

/* Status */
.status-msg {
    margin-top: 16px; padding: 14px 16px;
    border-radius: 10px; font-size: 13px;
    animation: fadeIn 0.3s ease;
}
.status-msg.error {
    background: rgba(244,67,54,0.08); color: #f44336;
    border: 1px solid rgba(244,67,54,0.2);
    box-shadow: 0 0 20px rgba(244,67,54,0.05);
}

/* ── Builds table ── */
.card { overflow-x: auto; }
.builds { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 600px; }
.builds th {
    text-align: left; padding: 10px 8px;
    color: #666; font-size: 11px; text-transform: uppercase;
    letter-spacing: 1px; border-bottom: 1px solid rgba(124,92,252,0.08);
}
.builds td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.2s;
}
.builds tr:last-child td { border-bottom: none; }
.builds tr:hover td { background: rgba(124,92,252,0.03); }
.fname { font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date { color: #555; white-space: nowrap; font-size: 12px; }
.actions { white-space: nowrap; text-align: right; }
.mode-tag {
    font-size: 10px; padding: 3px 8px;
    background: rgba(124,92,252,0.1); color: #7c5cfc;
    border-radius: 6px; font-weight: 600;
}

/* Small buttons */
.btn-sm {
    font-size: 10px; padding: 4px 10px; border-radius: 5px;
    cursor: pointer; border: 1px solid #2a2a3a;
    background: transparent; color: #777;
    font-weight: 600; text-decoration: none;
    transition: all 0.25s ease; display: inline-block;
}
.btn-sm:hover { transform: translateY(-1px); }
.btn-dl { color: #4caf50; border-color: rgba(76,175,80,0.2); }
.btn-dl:hover { background: rgba(76,175,80,0.08); box-shadow: 0 0 12px rgba(76,175,80,0.1); }
.btn-copy-sm { color: #7c5cfc; border-color: rgba(124,92,252,0.2); }
.btn-copy-sm:hover { background: rgba(124,92,252,0.08); box-shadow: 0 0 12px rgba(124,92,252,0.1); }
.btn-del { color: #f44336; border-color: rgba(244,67,54,0.15); }
.btn-del:hover { background: rgba(244,67,54,0.08); box-shadow: 0 0 12px rgba(244,67,54,0.08); }

.empty-state { text-align: center; padding: 32px; color: #555; font-size: 13px; }

/* ── Quote overlay ── */
.quote-overlay {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(10,10,15,0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    animation: quoteFade 0.4s ease;
    pointer-events: none;
}
.quote-overlay.out { animation: quoteFadeOut 0.5s ease forwards; }
.quote-text {
    font-size: 28px; font-weight: 700;
    color: #7c5cfc; text-align: center;
    text-shadow: 0 0 40px rgba(124,92,252,0.4), 0 0 80px rgba(124,92,252,0.2);
    padding: 0 40px;
    animation: quoteGlow 2s ease-in-out infinite alternate;
}
@keyframes quoteFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes quoteFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes quoteGlow {
    from { text-shadow: 0 0 30px rgba(124,92,252,0.3), 0 0 60px rgba(124,92,252,0.15); }
    to { text-shadow: 0 0 50px rgba(124,92,252,0.5), 0 0 100px rgba(124,92,252,0.25); }
}

/* ── Toast ── */
.toast {
    position: fixed; bottom: -50px; left: 50%; transform: translateX(-50%);
    background: rgba(124,92,252,0.9);
    backdrop-filter: blur(10px);
    color: #fff; padding: 10px 28px; border-radius: 10px;
    font-size: 13px; font-weight: 600;
    box-shadow: 0 8px 32px rgba(124,92,252,0.3);
    transition: bottom 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 9999;
}
.toast.show { bottom: 24px; }
