:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #0ea5e9;
    --accent: #22d3ee;
    --danger: #ef4444;

    --bg-dark: #0f0f23;
    --bg-darker: #080816;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.72);
    --border-color: rgba(255, 255, 255, 0.12);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.28);

    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #0ea5e9 50%, #22d3ee 100%);
    --gradient-card: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(14, 165, 233, 0.05) 100%);
    --gradient-glow: linear-gradient(135deg, rgba(99, 102, 241, 0.5) 0%, rgba(34, 211, 238, 0.3) 100%);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text-primary);
    font-family: "Poppins", "Segoe UI", sans-serif;
    background: var(--bg-dark);
    overflow-x: hidden;
}

.bg-animation {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.bg-gradient {
    position: absolute;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(14, 165, 233, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(34, 211, 238, 0.08) 0%, transparent 60%),
        linear-gradient(180deg, var(--bg-darker) 0%, var(--bg-dark) 50%, var(--bg-darker) 100%);
}

.floating-shapes .shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out;
}

.shape-1 { width: 360px; height: 360px; background: var(--primary); top: -10%; left: -6%; }
.shape-2 { width: 280px; height: 280px; background: var(--secondary); top: 60%; right: -4%; animation-delay: -5s; }
.shape-3 { width: 240px; height: 240px; background: var(--accent); bottom: -6%; left: 30%; animation-delay: -10s; }
.shape-4 { width: 210px; height: 210px; background: var(--primary-light); top: 28%; left: 62%; animation-delay: -15s; }

.grid-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    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: 80px 80px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 80%);
}

.container {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    margin: 0 auto;
    padding: 26px 18px 44px;
}

.card {
    position: relative;
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--gradient-glow);
    opacity: 0;
    transition: 0.3s ease;
    pointer-events: none;
}

.card:hover::before { opacity: 0.09; }

.card-hero {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    padding: 20px;
}

.hero-content { max-width: 700px; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--gradient-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
    font-weight: 500;
}

.hero-title {
    margin: 10px 0 6px;
    font-size: clamp(1.7rem, 2.9vw, 2.45rem);
    font-weight: 800;
    line-height: 1.15;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.98rem;
}

.card-elevated {
    padding: 18px;
    margin-bottom: 16px;
    transform-style: preserve-3d;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card-elevated:hover {
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: var(--shadow-glow);
}

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(22px) scale(0.985);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-on-scroll.animate-in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #f1f7ff;
}

textarea {
    width: 100%;
    min-height: 250px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 255, 0.32);
    background: rgba(8, 12, 29, 0.88);
    color: var(--text-primary);
    padding: 14px;
    resize: vertical;
    line-height: 1.6;
    font-family: "Poppins", sans-serif;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

textarea:focus {
    outline: none;
    border-color: rgba(14, 165, 233, 0.75);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.16);
}

.toolbar {
    margin-top: 13px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.btn {
    border: 0;
    cursor: pointer;
    border-radius: 12px;
    padding: 10px 14px;
    color: #fff;
    font-family: "Poppins", sans-serif;
    font-weight: 600;
    font-size: 0.89rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0, 8, 25, 0.3);
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: "";
    position: absolute;
    top: -10%;
    left: -130%;
    width: 65%;
    height: 120%;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0));
    transform: skewX(-20deg);
    transition: left 0.45s ease;
    pointer-events: none;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(0, 12, 38, 0.38); }
.btn:hover::after { left: 135%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:disabled::after { display: none; }

.btn-primary { background: var(--gradient-primary); box-shadow: var(--shadow-glow); }
.btn-secondary { background: linear-gradient(120deg, var(--primary-dark), var(--secondary)); }
.btn-danger { background: linear-gradient(120deg, #dc3b6b, var(--danger)); }
.btn-portal { background: linear-gradient(120deg, rgba(255, 255, 255, 0.1), rgba(129, 140, 248, 0.26)); }

input[type="file"], select, input[type="range"] {
    background: rgba(7, 11, 28, 0.85);
    color: var(--text-primary);
    border: 1px solid rgba(148, 163, 255, 0.3);
    border-radius: 10px;
    padding: 9px 10px;
    font-family: "Poppins", sans-serif;
}

input[type="file"] { min-width: 240px; }
input[type="range"] { width: 100%; }

.voice-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.status {
    margin-top: 10px;
    color: #92dfff;
    font-size: 0.92rem;
    font-weight: 500;
}

.voice-health {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.voice-health-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f59e0b;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

.voice-health.ok {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.14);
    color: #bbf7d0;
}

.voice-health.ok .voice-health-dot {
    background: #10b981;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.65);
}

.voice-health.warn {
    border-color: rgba(239, 68, 68, 0.45);
    background: rgba(239, 68, 68, 0.14);
    color: #fecaca;
}

.voice-health.warn .voice-health-dot {
    background: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.65);
}

h3 { margin: 8px 0 10px; font-size: 1.08rem; font-weight: 600; }
h3 i { color: #93a2ff; }

.summary-box {
    background: rgba(8, 12, 30, 0.9);
    border: 1px dashed rgba(129, 140, 248, 0.5);
    border-radius: 14px;
    padding: 14px;
    min-height: 100px;
    line-height: 1.65;
    white-space: pre-wrap;
}

.note { color: var(--text-secondary); font-size: 0.86rem; margin-top: 10px; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    25% { transform: translate(30px, -30px) rotate(5deg) scale(1.05); }
    50% { transform: translate(-20px, 20px) rotate(-5deg) scale(0.95); }
    75% { transform: translate(-30px, -20px) rotate(3deg) scale(1.02); }
}

@media (max-width: 700px) {
    .toolbar .btn { width: 100%; justify-content: center; }
    input[type="file"] { width: 100%; }
}
