/* =============================================
   Puerta de Hierro — Landing Page
   ============================================= */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-charcoal);
    background-color: var(--color-ivory);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-forest);
    text-decoration: none;
    transition: color 0.25s ease;
}

a:hover {
    color: var(--color-deep-green);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input {
    font-family: inherit;
    font-size: inherit;
}

/* --- Variables --- */
:root {
    --color-deep-green: #18382f;
    --color-forest: #244f42;
    --color-sage: #8fae9b;
    --color-ivory: #f7f3ea;
    --color-warm-white: #fffaf2;
    --color-champagne: #c8a96a;
    --color-soft-gold: #e3cf9a;
    --color-charcoal: #1f2723;
    --color-muted: #6f7c73;

    --shadow-soft: 0 18px 45px rgba(24, 56, 47, 0.14);
    --shadow-nav: 0 10px 30px rgba(24, 56, 47, 0.12);
    --shadow-login: 0 22px 60px rgba(24, 56, 47, 0.18);

    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;
    --radius-full: 9999px;

    --nav-max: 1180px;
    --header-height: 84px;
    --transition: 0.25s ease;
}

/* --- Header --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(247, 243, 234, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(200, 169, 106, 0.24);
    box-shadow: var(--shadow-nav);
}

.site-header.is-expanded {
    box-shadow: var(--shadow-soft);
}

.nav-inner {
    min-height: var(--header-height);
    width: min(100% - 40px, var(--nav-max));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.brand {
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    font-weight: 700;
    color: var(--color-deep-green);
    letter-spacing: -0.03em;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-end {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- Nav links (desktop secondary) --- */
.nav-link {
    min-height: 44px;
    padding: 0 18px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-deep-green);
    text-decoration: none;
    border: 1px solid transparent;
    background: transparent;
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-link:hover {
    border-color: rgba(200, 169, 106, 0.45);
    background: rgba(255, 250, 242, 0.75);
    color: var(--color-deep-green);
}

/* --- Language switch --- */
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: var(--radius-full);
    background: rgba(255, 250, 242, 0.72);
    border: 1px solid rgba(200, 169, 106, 0.28);
    flex-shrink: 0;
}

.lang-btn {
    border: 0;
    border-radius: var(--radius-full);
    padding: 7px 11px;
    background: transparent;
    color: var(--color-deep-green);
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all var(--transition);
}

.lang-btn.active {
    background: var(--color-deep-green);
    color: var(--color-warm-white);
}

.lang-btn:not(.active):hover {
    background: rgba(200, 169, 106, 0.15);
}

/* --- Portal toggle (desktop primary) --- */
.portal-toggle {
    min-height: 46px;
    padding: 0 22px;
    border-radius: var(--radius-full);
    background: var(--color-deep-green);
    color: var(--color-warm-white);
    border: 1px solid rgba(200, 169, 106, 0.35);
    box-shadow: 0 10px 24px rgba(24, 56, 47, 0.18);
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: all var(--transition);
}

.portal-toggle:hover {
    background: var(--color-forest);
}

.portal-toggle[aria-expanded="true"] {
    background: var(--color-forest);
}

/* --- Mobile menu toggle --- */
.mobile-menu-toggle {
    display: none;
    min-height: 40px;
    padding: 0 15px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(200, 169, 106, 0.35);
    background: rgba(255, 250, 242, 0.78);
    color: var(--color-deep-green);
    font-weight: 700;
    font-size: 0.9rem;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.mobile-menu-toggle:hover {
    background: rgba(200, 169, 106, 0.2);
}

.mobile-menu-toggle[aria-expanded="true"] {
    background: var(--color-deep-green);
    color: var(--color-warm-white);
    border-color: var(--color-deep-green);
}

/* --- Mobile panel --- */
.mobile-panel {
    display: none;
    width: min(100% - 28px, var(--nav-max));
    margin: 0 auto 14px;
    padding: 14px;
    border-radius: 22px;
    background: rgba(255, 250, 242, 0.96);
    border: 1px solid rgba(200, 169, 106, 0.24);
    box-shadow: var(--shadow-soft);
    grid-template-columns: 1fr;
    gap: 10px;
}

.mobile-panel.is-open {
    animation: panelDown 0.22s ease both;
}

.mobile-panel-link,
.mobile-panel-btn {
    width: 100%;
    min-height: 48px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition);
}

.mobile-panel-link {
    color: var(--color-deep-green);
    border: 1px solid rgba(200, 169, 106, 0.3);
    background: rgba(255, 250, 242, 0.6);
}

.mobile-panel-link:hover {
    background: rgba(200, 169, 106, 0.18);
    color: var(--color-charcoal);
}

.mobile-panel-btn {
    background: var(--color-deep-green);
    color: var(--color-warm-white);
    border: 1px solid rgba(200, 169, 106, 0.35);
    box-shadow: 0 8px 20px rgba(24, 56, 47, 0.15);
    font-weight: 700;
}

.mobile-panel-btn:hover,
.mobile-panel-btn[aria-expanded="true"] {
    background: var(--color-forest);
}

/* --- Login panel --- */
.login-panel {
    display: none;
    position: absolute;
    right: max(20px, calc((100vw - var(--nav-max)) / 2));
    top: calc(100% + 12px);
    width: min(420px, calc(100vw - 32px));
    padding: 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 250, 242, 0.98);
    border: 1px solid rgba(200, 169, 106, 0.28);
    box-shadow: var(--shadow-login);
    z-index: 1001;
}

.login-panel.is-open {
    display: block;
    animation: panelDown 0.22s ease both;
}

.login-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: end;
}

.form-group label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-muted);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.form-group input {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid rgba(200, 169, 106, 0.35);
    border-radius: var(--radius-sm);
    background: var(--color-warm-white);
    color: var(--color-charcoal);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-sage);
    box-shadow: 0 0 0 3px rgba(143, 174, 155, 0.2);
}

.btn-login {
    grid-column: 1 / -1;
    min-height: 46px;
    padding: 0 22px;
    border-radius: var(--radius-full);
    background: var(--color-deep-green);
    color: var(--color-warm-white);
    border: 1px solid rgba(200, 169, 106, 0.35);
    font-weight: 700;
    font-size: 0.95rem;
    transition: all var(--transition);
}

.btn-login:hover {
    background: var(--color-forest);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-message {
    margin-top: 0.75rem;
    font-size: 0.84rem;
    min-height: 1.25rem;
    text-align: center;
    transition: color var(--transition);
}

.login-message.is-error {
    color: #a63d32;
}

.login-message.is-success {
    color: var(--color-forest);
}

/* --- Hero --- */
.hero {
    position: relative;
    min-height: clamp(520px, calc(100vh - var(--header-height)), 760px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        rgba(20, 39, 31, 0.28),
        rgba(20, 39, 31, 0.18)
    );
    pointer-events: none;
}

.hero-bg {
    position: absolute;
    inset: 0;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem 1.5rem;
    animation: fadeInUp 1s ease-out;
}

.hero-title {
    font-size: clamp(3rem, 7vw, 6.5rem);
    font-weight: 600;
    color: var(--color-warm-white);
    letter-spacing: 0.04em;
    text-shadow: 0 8px 28px rgba(0, 0, 0, 0.24);
    line-height: 1.1;
}

/* --- Info section --- */
.info-section {
    padding: clamp(48px, 7vw, 90px) 0;
    background: var(--color-ivory);
}

.info-grid {
    width: min(100% - 40px, var(--nav-max));
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.info-card {
    background: var(--color-warm-white);
    border-radius: var(--radius-lg);
    padding: 2rem 1.75rem;
    box-shadow: var(--shadow-nav);
    border: 1px solid rgba(200, 169, 106, 0.2);
    transition: transform var(--transition), box-shadow var(--transition);
    animation: fadeInUp 0.7s ease-out backwards;
}

.info-card:nth-child(1) { animation-delay: 0.1s; }
.info-card:nth-child(2) { animation-delay: 0.2s; }
.info-card:nth-child(3) { animation-delay: 0.3s; }

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-soft);
}

.info-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-deep-green), var(--color-forest));
    color: var(--color-warm-white);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.info-card h2 {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-muted);
    margin-bottom: 0.5rem;
}

.info-value {
    font-size: 1.05rem;
    color: var(--color-charcoal);
    line-height: 1.65;
}

.info-value a {
    font-weight: 500;
    color: var(--color-forest);
}

.info-value a:hover {
    color: var(--color-champagne);
}

/* --- Footer --- */
.site-footer {
    padding: 2.25rem 0;
    text-align: center;
    border-top: 1px solid rgba(200, 169, 106, 0.2);
    background: var(--color-ivory);
}

.footer-inner {
    width: min(100% - 40px, var(--nav-max));
    margin: 0 auto;
}

.site-footer p {
    font-size: 0.85rem;
    color: var(--color-muted);
    letter-spacing: 0.04em;
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes panelDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Responsive --- */
@media (max-width: 820px) {
    :root {
        --header-height: 72px;
    }

    .nav-inner {
        width: min(100% - 28px, var(--nav-max));
        min-height: var(--header-height);
        gap: 14px;
    }

    .brand {
        font-size: 1.22rem;
    }

    .nav-actions,
    .portal-toggle {
        display: none;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

    .nav-end {
        gap: 10px;
    }

    .mobile-panel.is-open {
        display: grid;
    }

    .mobile-panel.is-open + .login-panel.is-open {
        margin-top: -2px;
        border-top: none;
        border-radius: 0 0 18px 18px;
        box-shadow: var(--shadow-soft);
    }

    .mobile-panel.is-open:has(+ .login-panel.is-open) {
        margin-bottom: 0;
        border-radius: 22px 22px 0 0;
        box-shadow: none;
    }

    .login-panel {
        position: static;
        width: min(100% - 28px, var(--nav-max));
        margin: 0 auto 14px;
        box-shadow: none;
        border-radius: 18px;
    }

    .login-fields {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: 62vh;
    }

    .hero-title {
        font-size: clamp(3rem, 15vw, 4.8rem);
        letter-spacing: -0.04em;
    }

    .info-grid {
        width: min(100% - 28px, var(--nav-max));
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

@media (max-width: 400px) {
    .brand {
        font-size: 1.1rem;
    }

    .lang-btn {
        padding: 6px 9px;
        font-size: 0.74rem;
    }

    .mobile-menu-toggle {
        padding: 0 12px;
        font-size: 0.85rem;
    }
}
