/* ============================================
   Transportes Cádiz — Home page styles
   Metodología BEM · Sin framework CSS
   ============================================ */

/* === TOKENS =================================== */
:root {
    --primary:          #2c792a;
    --primary-dark:     #256126;
    --primary-light:    rgba(44, 121, 42, 0.10);
    --primary-shadow:   rgba(44, 121, 42, 0.22);

    --bg-page:          #f6f8f6;
    --bg-page-dark:     #141e14;
    --surface:          #ffffff;
    --surface-alt:      #f8fafc;

    --border:           #f1f5f9;
    --border-dark:      #1e293b;

    --text-base:        #0f172a;
    --text-muted:       #475569;
    --text-subtle:      #94a3b8;
    --text-inverted:    #f1f5f9;

    --amber-bg:         #fffbeb;
    --amber-border:     #fbbf24;
    --amber-text:       #92400e;
    --blue-bg:          #dbeafe;
    --blue-icon:        #2563eb;

    --font:             'Inter', sans-serif;

    --shadow-card:      0 10px 30px -10px rgba(44, 121, 42, 0.10);
    --shadow-primary:   0 4px 20px rgba(44, 121, 42, 0.25);

    --radius-xs:        0.5rem;
    --radius-sm:        1rem;
    --radius-md:        1.5rem;
    --radius-full:      9999px;
}

/* === RESET ==================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul, ol { list-style: none; }

/* === BASE ===================================== */
body {
    font-family: var(--font);
    background-color: var(--bg-page);
    color: var(--text-base);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (prefers-color-scheme: dark) {
    body {
        background-color: var(--bg-page-dark);
        color: var(--text-inverted);
    }
}

/* === SITE HEADER ============================== */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    background-color: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

@media (prefers-color-scheme: dark) {
    .site-header {
        background-color: rgba(20, 30, 20, 0.82);
        border-color: var(--border-dark);
    }
}

.site-header__nav {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-header__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-header__brand-icon {
    background-color: var(--primary);
    color: #fff;
    padding: 0.5rem;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.site-header__brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text-base);
}

@media (prefers-color-scheme: dark) {
    .site-header__brand-name { color: #fff; }
}

.site-header__menu {
    display: none;
    align-items: center;
    gap: 2rem;
}

@media (min-width: 768px) {
    .site-header__menu { display: flex; }
}

.site-header__link {
    font-size: 0.875rem;
    font-weight: 600;
    transition: color 0.15s;
}
.site-header__link:hover { color: var(--primary); }

.site-header__cta {
    background-color: var(--primary);
    color: #fff;
    padding: 0.625rem 1.5rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 700;
    transition: background-color 0.15s, transform 0.15s;
}
.site-header__cta:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

/* === HERO ===================================== */
.hero {
    position: relative;
    padding: 8rem 1.5rem 8rem;
    overflow: hidden;
}

.hero__inner {
    max-width: 56rem;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero__badge {
    display: inline-block;
    padding: 0.25rem 1rem;
    border-radius: var(--radius-full);
    background-color: var(--primary-light);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
}

.hero__title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.025em;
    color: var(--text-base);
    margin-bottom: 2rem;
}

@media (prefers-color-scheme: dark) {
    .hero__title { color: #fff; }
}

.hero__title--accent { color: var(--primary); }

.hero__description {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-muted);
    max-width: 42rem;
    margin: 0 auto 3rem;
    line-height: 1.625;
}

@media (prefers-color-scheme: dark) {
    .hero__description { color: var(--text-subtle); }
}

.hero__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 5rem;
}

@media (min-width: 640px) {
    .hero__actions { flex-direction: row; }
}

.hero__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border-radius: var(--radius-xs);
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.15s;
    width: 100%;
}

@media (min-width: 640px) {
    .hero__btn { width: auto; }
}

.hero__btn--primary {
    background-color: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-primary);
}
.hero__btn--primary:hover { background-color: var(--primary-dark); }

.hero__btn--secondary {
    background-color: var(--surface);
    color: var(--text-base);
    border: 1px solid #e2e8f0;
}
.hero__btn--secondary:hover { background-color: var(--surface-alt); }

@media (prefers-color-scheme: dark) {
    .hero__btn--secondary {
        background-color: #1e293b;
        border-color: #334155;
        color: var(--text-inverted);
    }
    .hero__btn--secondary:hover { background-color: #293548; }
}

/* Phone mockup */
.hero__mockup {
    position: relative;
    margin: 0 auto;
    max-width: 320px;
}

@media (min-width: 768px) {
    .hero__mockup { max-width: 400px; }
}

.hero__phone {
    border-radius: 3rem;
    padding: 1rem;
    background-color: #0f172a;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    border: 8px solid #1e293b;
}

.hero__phone-screen {
    width: 100%;
    border-radius: 2.5rem;
    background-color: #f1f5f9;
}

/* Floating notification cards */
.hero__floating-card {
    position: absolute;
    background-color: var(--surface);
    padding: 1rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 1rem;
    white-space: nowrap;
}

@media (prefers-color-scheme: dark) {
    .hero__floating-card { background-color: #1e293b; }
}

.hero__floating-card--tram {
    top: -2.5rem;
    left: -2.5rem;
    animation: bounce 1s ease-in-out infinite;
}

@media (min-width: 768px) {
    .hero__floating-card--tram { left: -5rem; }
}

.hero__floating-card--location {
    top: 50%;
    right: -2.5rem;
    transform: translateY(-50%);
}

@media (min-width: 768px) {
    .hero__floating-card--location { right: -6rem; }
}

.hero__card-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hero__card-icon--tram {
    background-color: var(--blue-bg);
    color: var(--blue-icon);
}

.hero__card-icon--location {
    background-color: var(--primary-light);
    color: var(--primary);
}

.hero__card-label {
    font-size: 0.625rem;
    color: var(--text-subtle);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.2;
}

.hero__card-value {
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.3;
}

/* === SECTION HEADER (reutilizable) ============ */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header__title {
    font-size: clamp(1.875rem, 4vw, 2.25rem);
    font-weight: 800;
    color: var(--text-base);
    margin-bottom: 1rem;
}

@media (prefers-color-scheme: dark) {
    .section-header__title { color: #fff; }
}

.section-header__divider {
    height: 4px;
    width: 5rem;
    background-color: var(--primary);
    margin: 0 auto;
    border-radius: var(--radius-full);
}

.section-header__subtitle {
    color: var(--text-muted);
    margin-top: 0.75rem;
}

@media (prefers-color-scheme: dark) {
    .section-header__subtitle { color: var(--text-subtle); }
}

/* === FEATURES ================================= */
.features {
    padding: 6rem 1.5rem;
    background-color: var(--surface);
}

@media (prefers-color-scheme: dark) {
    .features { background-color: rgba(20, 30, 20, 0.5); }
}

.features__inner {
    max-width: 80rem;
    margin: 0 auto;
}

.features__grid {
    display: grid;
    gap: 2rem;
}

@media (min-width: 768px) {
    .features__grid { grid-template-columns: repeat(3, 1fr); }
}

/* Feature card */
.feature-card {
    background-color: var(--bg-page);
    padding: 2.5rem;
    border-radius: var(--radius-xs);
    transition: transform 0.3s ease;
}

.feature-card:hover { transform: translateY(-8px); }

@media (prefers-color-scheme: dark) {
    .feature-card { background-color: rgba(30, 41, 59, 0.5); }
}

.feature-card__icon {
    width: 3.5rem;
    height: 3.5rem;
    background-color: var(--primary);
    color: #fff;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-primary);
}

.feature-card__icon .material-symbols-outlined {
    font-size: 1.875rem;
}

.feature-card__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.feature-card__text {
    color: var(--text-muted);
    line-height: 1.625;
}

@media (prefers-color-scheme: dark) {
    .feature-card__text { color: var(--text-subtle); }
}

/* === HOW IT WORKS ============================= */
.how-it-works {
    padding: 6rem 1.5rem;
    overflow: hidden;
}

.how-it-works__inner {
    max-width: 80rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4rem;
}

@media (min-width: 1024px) {
    .how-it-works__inner { flex-direction: row; }
}

.how-it-works__content {
    width: 100%;
}

@media (min-width: 1024px) {
    .how-it-works__content { width: 50%; }
}

.how-it-works__title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-base);
    margin-bottom: 3rem;
}

@media (prefers-color-scheme: dark) {
    .how-it-works__title { color: #fff; }
}

.how-it-works__steps {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.step {
    display: flex;
    gap: 1.5rem;
}

.step__number {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    background-color: var(--primary);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.step__text {
    color: var(--text-muted);
    line-height: 1.6;
}

@media (prefers-color-scheme: dark) {
    .step__text { color: var(--text-subtle); }
}

.how-it-works__visual {
    width: 100%;
    display: flex;
    justify-content: center;
}

@media (min-width: 1024px) {
    .how-it-works__visual { width: 50%; }
}

.how-it-works__image-wrap {
    position: relative;
    width: 100%;
    max-width: 24rem;
}

.how-it-works__blob {
    position: absolute;
    inset: 0;
    background-color: var(--primary-light);
    border-radius: var(--radius-full);
    filter: blur(64px);
    z-index: 0;
}

.how-it-works__image {
    width: 100%;
    border-radius: var(--radius-xs);
    position: relative;
    z-index: 1;
}

/* === APP PREVIEW ============================== */
.app-preview {
    padding: 6rem 1.5rem;
    background-color: var(--surface-alt);
}

@media (prefers-color-scheme: dark) {
    .app-preview { background-color: rgba(15, 23, 42, 0.4); }
}

.app-preview__inner {
    max-width: 80rem;
    margin: 0 auto;
}

.app-preview__grid {
    display: grid;
    gap: 2rem;
}

@media (min-width: 768px) {
    .app-preview__grid { grid-template-columns: repeat(3, 1fr); }
}

/* Preview item */
.preview-item {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.preview-item__card {
    background-color: var(--surface);
    padding: 0.5rem;
    border-radius: var(--radius-xs);
    box-shadow: var(--shadow-card);
}

@media (prefers-color-scheme: dark) {
    .preview-item__card { background-color: #1e293b; }
}

.preview-item__image {
    width: 100%;
    border-radius: 0.5rem;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.preview-item__caption {
    text-align: center;
    font-weight: 700;
}

/* === ABOUT SECTION ============================ */
.about-section {
    padding: 6rem 1.5rem;
}

.about-section__inner {
    max-width: 80rem;
    margin: 0 auto;
    display: grid;
    gap: 4rem;
}

@media (min-width: 768px) {
    .about-section__inner { grid-template-columns: 1fr 1fr; }
}

/* About card */
.about-card {
    background-color: var(--surface);
    padding: 3rem;
    border-radius: var(--radius-xs);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
}

@media (prefers-color-scheme: dark) {
    .about-card {
        background-color: #1e293b;
        border-color: #334155;
    }
}

.about-card__title {
    font-size: 1.875rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.about-card__text {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.625;
}

@media (prefers-color-scheme: dark) {
    .about-card__text { color: var(--text-subtle); }
}

.about-card__disclaimer {
    padding: 1rem;
    background-color: var(--amber-bg);
    border-left: 4px solid var(--amber-border);
    color: var(--amber-text);
    font-size: 0.875rem;
    line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
    .about-card__disclaimer {
        background-color: rgba(120, 53, 15, 0.2);
        color: #fde68a;
    }
}

/* Author section */
.author-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.author-section__title {
    font-size: 1.875rem;
    font-weight: 800;
    margin-bottom: 2rem;
}

.author-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background-color: rgba(44, 121, 42, 0.05);
    border-radius: var(--radius-xs);
    border: 1px solid rgba(44, 121, 42, 0.1);
}

.author-card__avatar {
    width: 5rem;
    height: 5rem;
    flex-shrink: 0;
    border-radius: var(--radius-full);
    background-color: rgba(44, 121, 42, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.author-card__avatar .material-symbols-outlined {
    font-size: 2.5rem;
    color: var(--primary);
}

.author-card__name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.author-card__role {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

@media (prefers-color-scheme: dark) {
    .author-card__role { color: var(--text-subtle); }
}

.author-card__link {
    color: var(--primary);
    font-weight: 600;
    margin-top: 0.5rem;
    display: inline-block;
    font-size: 0.9375rem;
}
.author-card__link:hover { text-decoration: underline; }

/* === CTA BANNER =============================== */
.cta-banner {
    padding: 5rem 1.5rem;
}

.cta-banner__inner {
    max-width: 80rem;
    margin: 0 auto;
    background-color: var(--primary);
    border-radius: var(--radius-xs);
    padding: 3rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .cta-banner__inner { padding: 5rem; }
}

.cta-banner__blob {
    position: absolute;
    top: 0; right: 0;
    width: 24rem; height: 24rem;
    background-color: rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-full);
    filter: blur(48px);
    transform: translate(25%, -25%);
    pointer-events: none;
    z-index: 0;
}

.cta-banner__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

@media (min-width: 1024px) {
    .cta-banner__content { flex-direction: row; }
}

.cta-banner__text {
    text-align: center;
}

@media (min-width: 1024px) {
    .cta-banner__text {
        width: 50%;
        text-align: left;
    }
}

.cta-banner__title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.cta-banner__availability {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.10);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-xs);
    margin-bottom: 2.5rem;
    font-size: 1.125rem;
}

.cta-banner__actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 640px) {
    .cta-banner__actions { flex-direction: row; }
}

.cta-banner__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border-radius: var(--radius-xs);
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.15s;
}

.cta-banner__btn--android {
    background-color: #fff;
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.cta-banner__btn--android:hover { background-color: var(--surface-alt); }

.cta-banner__btn--ios {
    background-color: rgba(44, 121, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    opacity: 0.55;
    cursor: not-allowed;
    backdrop-filter: blur(8px);
}

.cta-banner__image-wrap {
    display: flex;
    justify-content: center;
}

@media (min-width: 1024px) {
    .cta-banner__image-wrap { width: 50%; }
}

.cta-banner__image {
    width: 100%;
    max-width: 17.5rem;
}

/* === SITE FOOTER ============================== */
.site-footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    padding: 4rem 1.5rem 2rem;
}

@media (prefers-color-scheme: dark) {
    .site-footer {
        background-color: var(--bg-page-dark);
        border-color: var(--border-dark);
    }
}

.site-footer__inner {
    max-width: 80rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

@media (min-width: 768px) {
    .site-footer__inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
}

.site-footer__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.site-footer__brand-icon {
    background-color: var(--primary);
    color: #fff;
    padding: 0.25rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-footer__brand-icon .material-symbols-outlined {
    font-size: 1.125rem;
}

.site-footer__brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.site-footer__tagline {
    color: var(--text-subtle);
    font-size: 0.875rem;
}

.site-footer__right {
    text-align: center;
}

@media (min-width: 768px) {
    .site-footer__right { text-align: right; }
}

.site-footer__author {
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

@media (prefers-color-scheme: dark) {
    .site-footer__author { color: var(--text-subtle); }
}

.site-footer__author-link {
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
}
.site-footer__author-link:hover { text-decoration: underline; }

.site-footer__social {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
    justify-content: center;
}

@media (min-width: 768px) {
    .site-footer__social { justify-content: flex-end; }
}

.site-footer__social-link {
    color: var(--text-subtle);
    transition: color 0.15s;
    line-height: 1;
    display: inline-flex;
}
.site-footer__social-link:hover { color: var(--primary); }

.site-footer__copyright {
    max-width: 80rem;
    margin: 2.5rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-subtle);
}

@media (prefers-color-scheme: dark) {
    .site-footer__copyright { border-color: var(--border-dark); }
}

/* === ANIMATIONS ================================ */
@keyframes bounce {
    0%, 100% {
        transform: translateY(-20%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

/* === ACCESIBILIDAD ============================= */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
