/* ===== Variables ===== */
:root {
    --bg-body-from: #1d4ed8;
    --bg-body-mid: #1e40af;
    --bg-body-to: #0f172a;
    --bg-card: #ffffff;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --text-main: #0f172a;
    --text-soft: #6b7280;
    --border-soft: #e5e7eb;
    --radius: 16px;
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.25);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(135deg, var(--bg-body-from), var(--bg-body-mid), var(--bg-body-to));
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Header ===== */
.header {
    text-align: center;
    padding: 1.8rem 1rem 1rem;
    color: #e5e7eb;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

/* ===== Layout ===== */
.container {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.preferences,
.preview {
    flex: 1 1 320px;
    background-color: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 1.7rem;
}

.preferences h2,
.preview h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

/* ===== Form ===== */
label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    color: var(--text-soft);
}

select,
input[type="color"],
textarea {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    font-size: 0.95rem;
    margin-bottom: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

select:focus,
input[type="color"]:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

/* Button */
#btn-generar {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    margin-top: 0.3rem;
    transition: transform 0.1s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.55);
}

#btn-generar:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.65);
}

#btn-generar:active {
    transform: translateY(0);
    box-shadow: 0 7px 18px rgba(37, 99, 235, 0.45);
    opacity: 0.95;
}

/* ===== Preview ===== */
.image-box {
    margin-top: 0.8rem;
    border-radius: 18px;
    border: 2px dashed var(--border-soft);
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    background: #f9fafb;
}

.image-box p {
    color: var(--text-soft);
    font-size: 0.95rem;
}

.image-box img {
    max-width: 100%;
    height: auto;
    border-radius: 22px;
    display: block;
}

/* ===== Footer ===== */
.footer {
    margin-top: auto;
    text-align: center;
    padding: 0.8rem 0.5rem 1.1rem;
    color: #cbd5f5;
    font-size: 0.85rem;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.98);
}

.footer p {
    letter-spacing: 0.03em;
}

/* Spinner animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .container {
        padding: 1rem;
    }

    .preferences,
    .preview {
        padding: 1.3rem;
    }
}
