:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-base: #cbd9ef;
    --card-bg: rgba(255, 255, 255, 0.4);
    --card-border: rgba(255, 255, 255, 0.5);
    --text-main: #1e293b;
    --text-muted: #475569;
    --font-family: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    padding: 2rem 1rem;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 500px;
    margin: auto;
    /* Centers when small, allows top-scrolling when large */
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fadeIn 0.8s ease-out;
}

.header {
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #3b404b, #181d25);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header p {
    color: #1d2633;
    font-size: 1rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    opacity: 0.9;
}

.input-card {
    background: rgba(0, 0, 0, 0.15);
    /* Swapped: dark/transparent background for card */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
}

textarea {
    width: 100%;
    min-height: 150px;
    background: var(--card-bg);
    /* Swapped: glass/light background for textarea */
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.25rem;
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 1.1rem;
    line-height: 1.6;
    resize: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    overflow-y: hidden;
    /* Hide scrollbars, JS will handle height */
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: rgba(255, 255, 255, 0.7);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsiveness */
@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    textarea {
        min-height: 150px;
    }
}