:root {
    --bg: #0f172a;
    --bg-soft: #111827;
    --card: #1e293b;
    --primary: #38bdf8;
    --primary-dark: #0284c7;
    --text: #f8fafc;
    --muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.25);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* Header estilo DAT */

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.nav {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    color: var(--text);
    font-weight: 800;
    font-size: 1.4rem;
    text-decoration: none;
}

.brand span {
    color: var(--primary);
}

.brand:hover {
    color: var(--text);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    transition: 0.2s ease;
}

.back-link i {
    color: var(--primary);
}

.back-link:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(56, 189, 248, 0.08);
}

/* Hero / bloque principal */

.hero {
    min-height: auto;
    display: flex;
    align-items: center;
    padding-top: 110px;
    padding-bottom: 28px;
}

.badge-custom {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 14px;
    margin-bottom: 24px;
    background: rgba(56, 189, 248, 0.08);
}

.hero h1 {
    font-size: clamp(2.4rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: 24px;
}

.hero h1 span {
    color: var(--primary);
}

.hero-text {
    color: var(--muted);
    font-size: 1.1rem;
    max-width: 650px;
    line-height: 1.7;
}

/* Tarjeta base */

.profile-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 32px;
}

/* Tarjeta del tiempo */

.weather-card {
    position: relative;
    overflow: hidden;
}

.weather-card::before {
    content: "";
    position: absolute;
    top: -70px;
    right: -70px;
    width: 190px;
    height: 190px;
    background: rgba(56, 189, 248, 0.16);
    border-radius: 50%;
    filter: blur(8px);
}

.weather-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}

.weather-icon {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 2.2rem;
    flex-shrink: 0;
}

.weather-header h2 {
    margin: 0 0 6px 0;
    font-weight: 800;
    color: var(--text);
}

.weather-header p {
    margin: 0;
    color: var(--muted);
}

/* Información dentro de la tarjeta */

.profile-info {
    display: grid;
    gap: 12px;
    margin-top: 24px;
    position: relative;
    z-index: 1;
}

.profile-info div {
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.35);
}

.profile-info i {
    color: var(--primary);
    margin-right: 8px;
}

.weather-info div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.weather-info span {
    color: var(--muted);
}

.weather-info strong {
    margin-left: auto;
    color: var(--text);
    text-align: right;
}

#maxima,
#minima {
    color: var(--primary);
}

/* Botones de navegación del tiempo */

.weather-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 28px;
    position: relative;
    z-index: 1;
}

.btn-weather {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(56, 189, 248, 0.08);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: 0.2s ease;
}

.btn-weather:hover {
    background: var(--primary);
    color: #020617;
}

.btn-weather:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn-weather:disabled:hover {
    background: rgba(56, 189, 248, 0.08);
    color: var(--primary);
}

#contador-dia {
    color: var(--muted);
    font-weight: 600;
}

/* Sección gráfica */

.chart-section {
    padding: 0 0 45px;
}

.chart-card {
    position: relative;
    overflow: hidden;
}

.chart-card::before {
    content: "";
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 180px;
    height: 180px;
    background: rgba(56, 189, 248, 0.10);
    border-radius: 50%;
    filter: blur(8px);
}

.chart-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.chart-text {
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}

.chart-container {
    position: relative;
    z-index: 1;
    height: 330px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chart-container canvas {
    width: 700px !important;
    max-width: 100% !important;
    height: 330px !important;
    display: block;
}

/* Footer */

footer {
    border-top: 1px solid var(--border);
    padding: 10px 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

footer p {
    margin: 0;
}

/* Responsive tablet */

@media (max-width: 991px) {
    .hero {
        text-align: center;
        padding-top: 105px;
        padding-bottom: 24px;
    }

    .hero-text {
        margin: 0 auto;
    }

    .badge-custom {
        margin-left: auto;
        margin-right: auto;
    }

    .weather-header {
        justify-content: center;
    }

    .chart-section {
        padding-top: 0;
    }

    .chart-container {
        height: 310px;
    }

    .chart-container canvas {
        width: 100% !important;
        height: 310px !important;
    }
}

/* Responsive móvil */

@media (max-width: 576px) {
    .nav {
        min-height: 66px;
        gap: 12px;
    }

    .brand {
        font-size: 1.2rem;
    }

    .back-link {
        font-size: 0.85rem;
        padding: 8px 10px;
    }

    .hero {
        padding-top: 88px;
        padding-bottom: 18px;
    }

    .hero h1 {
        font-size: 2.35rem;
        margin-bottom: 18px;
    }

    .hero-text {
        font-size: 1rem;
        line-height: 1.55;
    }

    .badge-custom {
        margin-bottom: 18px;
    }

    .profile-card {
        padding: 20px;
        border-radius: 20px;
    }

    .weather-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        gap: 14px;
        margin-bottom: 22px;
    }

    .weather-icon {
        width: 62px;
        height: 62px;
        border-radius: 18px;
        font-size: 2rem;
    }

    .weather-header h2 {
        font-size: 1.35rem;
    }

    .profile-info {
        gap: 10px;
        margin-top: 18px;
    }

    .profile-info div {
        padding: 11px 12px;
    }

    .weather-info div {
        flex-wrap: wrap;
    }

    .weather-info strong {
        width: 100%;
        margin-left: 28px;
        text-align: left;
    }

    .weather-buttons {
        gap: 12px;
        margin-top: 22px;
    }

    .btn-weather {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    #contador-dia {
        font-size: 0.9rem;
    }

    .chart-section {
        padding: 0 0 32px;
    }

    .chart-card {
        padding: 18px;
        border-radius: 20px;
    }

    .chart-title {
        font-size: 1.25rem;
        margin-bottom: 8px;
    }

    .chart-text {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 14px;
    }

    .chart-container {
        height: 300px;
        width: 100%;
        overflow: hidden;
    }

    .chart-container canvas {
        width: 100% !important;
        max-width: 100% !important;
        height: 300px !important;
    }

    footer {
        padding: 8px 0;
        font-size: 0.8rem;
    }
}

/* Móviles muy estrechos */

@media (max-width: 380px) {
    .back-link {
        font-size: 0.8rem;
        padding: 7px 8px;
    }

    .hero h1 {
        font-size: 2.1rem;
    }

    .chart-container {
        height: 280px;
    }

    .chart-container canvas {
        height: 280px !important;
    }
}