:root {
    --primary-color: #0f172a;
    --primary-light: #1e293b;
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --success-color: #10b981;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #334155;
    --text-muted: #64748b;
    --error-color: #ef4444;
    --border-color: #e2e8f0;
    --ring-color: rgba(99, 102, 241, 0.2);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.05), 0 8px 10px -6px rgb(0 0 0 / 0.05);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    /* Malla de puntos sutil combinada con un degradado de fondo premium */
    background-color: #f8fafc;
    background-image:
        radial-gradient(circle at center, rgba(99, 102, 241, 0.1) 2px, transparent 2px),
        linear-gradient(-45deg, #f8fafc, #e0e7ff, #fcf8ff, #ede9fe);
    background-size: 28px 28px, 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-color);
    line-height: 1.6;
    padding: 3rem 1.5rem;
    min-height: 100vh;
}

@keyframes gradientBG {
    0% {
        background-position: 0 0, 0% 50%;
    }

    50% {
        background-position: 0 0, 100% 50%;
    }

    100% {
        background-position: 0 0, 0% 50%;
    }
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

.calculator-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 2.5rem 3rem;
    border-radius: 1.25rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.8);
    margin-bottom: 4rem;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    overflow: hidden;
}

.calculator-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), #a855f7);
}

.form-group {
    margin-bottom: 1.75rem;
}

label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--primary-light);
}

input[type="number"],
select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    font-size: 1.05rem;
    color: var(--primary-color);
    background-color: #f8fafc;
    transition: all 0.2s ease;
}

input[type="number"]::placeholder {
    color: #94a3b8;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px var(--ring-color);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-top: 0.5rem;
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--primary-light);
}

.radio-label input {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--accent-color);
    cursor: pointer;
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 2rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.875rem;
    background-color: transparent;
    color: var(--primary-light);
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1.5rem;
}

.btn-secondary:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-secondary:active {
    transform: scale(0.98);
}

.btn-secondary.copied {
    background-color: #ecfdf5;
    color: var(--success-color);
    border-color: var(--success-color);
}

.results-container {
    margin-top: 2.5rem;
    padding: 1.5rem;
    background-color: #f8fafc;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    animation: slideDown 0.3s ease-out forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.result-line:not(.total) {
    color: var(--text-muted);
}

.result-line.total {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 2px dashed #cbd5e1;
}

.value {
    font-weight: 600;
    color: var(--primary-color);
}

.value-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-icon:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background-color: #f8fafc;
}

.btn-icon:active {
    transform: scale(0.92);
}

.btn-icon.copied {
    color: var(--success-color);
    border-color: var(--success-color);
}

.btn-icon.copied svg {
    stroke: var(--success-color);
}

.error-message {
    color: #b91c1c;
    background-color: #fef2f2;
    padding: 1rem;
    border-radius: 0.75rem;
    margin-top: 1.5rem;
    font-size: 0.95rem;
    text-align: center;
    border: 1px solid #fecaca;
    font-weight: 500;
}

/* SEO Content Styles (Premium formatting) */
.seo-content,
.seo-authority-content {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 1.25rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-top: 3rem;
    margin-bottom: 2rem;
}

.seo-content h2,
.seo-authority-content h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 2rem 0 1rem;
    letter-spacing: -0.025em;
}

.seo-content h2:first-child,
.seo-authority-content h2:first-child {
    margin-top: 0;
}

.seo-content h3,
.seo-authority-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-light);
    margin: 1.5rem 0 0.75rem;
}

.seo-content h4,
.seo-authority-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-light);
    margin: 1.25rem 0 0.5rem;
}

.seo-content p,
.seo-authority-content p {
    margin-bottom: 1.25rem;
    color: var(--text-color);
    font-size: 1.05rem;
    line-height: 1.7;
}

.seo-content ul,
.seo-authority-content ul {
    margin-bottom: 1.5rem;
    padding-left: 1.25rem;
    list-style-type: none;
}

.seo-content li,
.seo-authority-content li {
    margin-bottom: 0.75rem;
    position: relative;
    padding-left: 1.5rem;
    color: var(--text-color);
}

.seo-content li::before,
.seo-authority-content li::before {
    content: "•";
    color: var(--accent-color);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    position: absolute;
    left: 0;
}

.faq-item {
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: 0.75rem;
    border-left: 4px solid var(--accent-color);
    margin-bottom: 1.25rem;
}

.faq-item strong {
    display: block;
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.faq-item p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Acordeones (Detalles) Premium */
details {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

details[open] {
    background: white;
    box-shadow: var(--shadow-sm);
    border-color: #cbd5e1;
}

summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color);
    cursor: pointer;
    list-style: none;
    /* Firefox */
    user-select: none;
    transition: background-color 0.2s ease;
}

summary::-webkit-details-marker {
    display: none;
    /* Safari/Chrome */
}

summary::after {
    content: '+';
    font-size: 1.5rem;
    line-height: 1;
    font-weight: 400;
    color: var(--accent-color);
    transition: transform 0.3s ease;
}

details[open] summary::after {
    content: '−';
    transform: rotate(180deg);
}

summary:hover {
    background: #f1f5f9;
}

details[open] summary {
    border-bottom: 1px dashed var(--border-color);
    background: transparent;
}

.details-content {
    padding: 1.5rem;
    color: var(--text-color);
    font-size: 1.05rem;
    line-height: 1.7;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modificamos los estilos antiguos para que encajen dentro de details-content */
.details-content h3,
.details-content h4 {
    color: var(--primary-light);
    margin: 1.5rem 0 0.5rem;
}

.details-content h3:first-child,
.details-content h4:first-child {
    margin-top: 0;
}

.details-content p {
    margin-bottom: 1rem;
}

.details-content ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    list-style-type: none;
}

.details-content li {
    margin-bottom: 0.5rem;
    position: relative;
}

.details-content li::before {
    content: "•";
    color: var(--accent-color);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    position: absolute;
    left: 0;
}

.cta-block {

    margin-top: 3rem;
    text-align: center;
    padding: 2.5rem;
    background: linear-gradient(to right, #f1f5f9, #f8fafc);
    border-radius: 1rem;
    border: 1px dashed #cbd5e1;
}

.cta-block p {
    font-weight: 500;
    color: var(--primary-color);
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #25d366;
    color: white;
    padding: 0.875rem 1.75rem;
    border-radius: 0.75rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    margin-top: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover {
    background-color: #22c35e;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}

/* Estilos extraídos del HTML inline para limpieza */
.seo-authority-content {
    max-width: 800px;
    margin: 40px auto;
}

/* Cajas de Consejos SEO */
.seo-tip-box {
    background: #f0fdf4;
    border-left: 4px solid var(--success-color);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
}

.seo-tip-box h4 {
    margin-top: 0 !important;
    color: #166534 !important;
    font-size: 1.15rem;
    margin-bottom: 0.5rem !important;
}

.seo-tip-box p {
    margin-bottom: 0 !important;
    color: #166534;
}

.seo-tip-box-blue {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
}

.seo-tip-box-blue h4 {
    margin-top: 0 !important;
    color: #1e40af !important;
    font-size: 1.15rem;
    margin-bottom: 0.5rem !important;
}

.seo-tip-box-blue p {
    margin-bottom: 0 !important;
    color: #1e3a8a;
}

/* Banner RGPD de Cookies */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    padding: 1.25rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    z-index: 9999;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-text {
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
    max-width: 800px;
}

.cookie-text a {
    color: var(--accent-color);
    text-decoration: underline;
    font-weight: 500;
}

.cookie-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.cookie-btn {
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cookie-btn-accept {
    background-color: var(--success-color);
    color: white;
}

.cookie-btn-accept:hover {
    background-color: #059669;
    transform: translateY(-2px);
}

.cookie-btn-reject {
    background-color: transparent;
    color: #94a3b8;
    border: 1px solid #475569;
}

.cookie-btn-reject:hover {
    background-color: #1e293b;
    color: white;
}

/* Mobile adjustments */
@media (max-width: 640px) {
    body {
        padding: 1.5rem 1rem;
    }

    .calculator-card {
        padding: 1.75rem 1.5rem;
    }

    .seo-content,
    .seo-authority-content {
        padding: 1.75rem 1.5rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }
}