/*
 * Public shell baseline extracted from the marketing prototype.
 * Scope every rule under `.public-shell` to avoid collisions with Bootstrap.
 */

.public-shell {
    --public-shell-max-width: min(1080px, 92vw);
    --public-shell-section-gap: clamp(3rem, 6vw, 6rem);
    --public-shell-grid-gap: clamp(1.5rem, 4vw, 3rem);
    font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: var(--fm-text-primary, var(--bs-body-color));
    background-color: var(--fm-surface, var(--bs-body-bg));
    padding-block: var(--public-shell-section-gap);
}

.public-shell.public-shell__header {
    padding-block: 1.5rem 0.75rem;
    background: var(--fm-surface, var(--bs-body-bg));
    color: var(--fm-text-primary, var(--bs-body-color));
}

.public-shell__header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(1rem, 4vw, 2.5rem);
}

.public-shell__logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.public-shell__logo-image {
    height: clamp(36px, 6vw, 48px);
    width: auto;
}

.public-shell__nav {
    display: inline-flex;
    align-items: center;
    gap: clamp(1rem, 3vw, 1.75rem);
    flex-wrap: wrap;
}

.theme-toggle {
    display: flex;
    align-items: center;
}

.theme-toggle .switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 52px;
    height: 28px;
    cursor: pointer;
}

.theme-toggle__checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-toggle .slider {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.35);
    transition: background 0.3s ease;
    cursor: pointer;
}

.theme-toggle .slider::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--fm-surface-strong, #fff);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.15);
    transition: transform 0.3s ease;
}

.theme-toggle__checkbox:checked + .slider {
    background: rgba(59, 130, 246, 0.55);
}

.theme-toggle__checkbox:checked + .slider::before {
    transform: translateX(24px);
}

.language-selector {
    position: relative;
}

.language-selector__button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: var(--fm-card-bg, rgba(255, 255, 255, 0.75));
    color: inherit;
    font-weight: 600;
    line-height: 1;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.language-selector__button:hover {
    border-color: rgba(59, 130, 246, 0.45);
}

.language-selector__button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.language-selector__caret {
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

.language-selector__flag {
    width: 24px;
    height: 16px;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
}

.language-selector__menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 180px;
    margin: 0;
    padding: 0.5rem;
    list-style: none;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: var(--fm-card-bg, rgba(255, 255, 255, 0.95));
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.language-selector__menu.is-open {
    animation: public-shell-dropdown-in 120ms ease-out;
}

.language-selector__option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0.65rem;
    border-radius: 10px;
    font-weight: 500;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.language-selector__option:hover,
.language-selector__option:focus-visible {
    background-color: rgba(59, 130, 246, 0.08);
    text-decoration: none;
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18);
}

.language-selector__option.is-active {
    background-color: rgba(59, 130, 246, 0.15);
    font-weight: 600;
}

.language-selector__option[aria-selected="true"]::after {
    content: "•";
    margin-left: auto;
    color: rgba(59, 130, 246, 0.9);
}

.language-selector__text {
    flex: 1;
}

@keyframes public-shell-dropdown-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

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

@media (max-width: 576px) {
    .public-shell.public-shell__header {
        padding-inline: clamp(1rem, 6vw, 1.5rem);
    }

    .public-shell__header-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .public-shell__nav {
        width: 100%;
        justify-content: space-between;
    }
}

.public-shell a {
    color: inherit;
    text-decoration: none;
}

.public-shell a:hover,
.public-shell a:focus {
    text-decoration: underline;
}

.public-shell__section {
    padding-block: var(--public-shell-section-gap);
}

.public-shell__container {
    width: 100%;
    max-width: var(--public-shell-max-width);
    margin-inline: auto;
    padding-inline: clamp(1.5rem, 5vw, 4rem);
}

.public-shell__hero {
    display: grid;
    gap: var(--public-shell-grid-gap);
    align-items: center;
}

.public-shell__hero-media {
    position: relative;
    display: flex;
    justify-content: center;
}

.public-shell__hero-media img,
.public-shell__hero-media picture {
    max-width: min(520px, 100%);
    width: 100%;
    height: auto;
    border-radius: 24px;
    box-shadow: 0 32px 60px rgba(16, 24, 40, 0.18);
}

.public-shell__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 999px;
    background-color: var(--fm-tag-bg, rgba(15, 118, 110, 0.1));
    color: var(--fm-tag-text, rgba(15, 118, 110, 0.9));
}

.public-shell__headline {
    font-size: clamp(2.5rem, 4vw, 3.75rem);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin-bottom: 1rem;
}

.public-shell__lead {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    line-height: 1.6;
    color: var(--fm-text-secondary, rgba(15, 23, 42, 0.72));
    margin-bottom: 1.5rem;
}

.public-shell__cta-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.public-shell__cta-group .btn-primary {
    padding-inline: clamp(1.5rem, 4vw, 2.25rem);
    padding-block: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 999px;
}

.public-shell__cta-group .btn-outline-light,
.public-shell__cta-group .btn-outline-dark {
    border-radius: 999px;
    padding-inline: clamp(1.25rem, 4vw, 2rem);
    padding-block: 0.75rem;
    font-weight: 600;
}

.public-shell__metrics {
    display: grid;
    gap: 1rem;
    margin-top: 2.5rem;
}

.public-shell__metric-card {
    padding: 1.25rem 1.5rem;
    border-radius: 18px;
    background-color: var(--fm-card-bg, rgba(255, 255, 255, 0.7));
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(6px);
}

.public-shell__metric-value {
    font-size: clamp(2rem, 3vw, 2.75rem);
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.public-shell__metric-label {
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    color: var(--fm-text-secondary, rgba(15, 23, 42, 0.72));
}

.public-shell__feature-grid {
    display: grid;
    gap: var(--public-shell-grid-gap);
}

.public-shell__feature-card {
    padding: 1.75rem;
    border-radius: 20px;
    background: var(--fm-card-bg, rgba(255, 255, 255, 0.75));
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.public-shell__feature-card h3 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.public-shell__feature-card p {
    margin-bottom: 0;
    color: var(--fm-text-secondary, rgba(15, 23, 42, 0.72));
    line-height: 1.6;
}

.public-shell__logo-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(120px, 1fr);
    gap: 1.5rem;
    align-items: center;
    justify-items: center;
    padding-block: 1.5rem;
    border-radius: 16px;
    background: var(--fm-card-bg, rgba(255, 255, 255, 0.6));
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.public-shell__logo-strip img {
    max-height: 36px;
    width: auto;
    opacity: 0.8;
}

.public-shell__section-title {
    font-size: clamp(2rem, 3vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.public-shell__section-subtitle {
    max-width: 52ch;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--fm-text-secondary, rgba(15, 23, 42, 0.7));
    margin-bottom: 2rem;
}

.public-shell__steps {
    display: grid;
    gap: 1.75rem;
    counter-reset: public-shell-steps;
}

.public-shell__step {
    display: grid;
    gap: 0.75rem;
    padding: 1.5rem;
    border-radius: 18px;
    background: var(--fm-card-bg, rgba(255, 255, 255, 0.75));
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.public-shell__step::before {
    counter-increment: public-shell-steps;
    content: counter(public-shell-steps, decimal-leading-zero);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--fm-accent, #0ea5e9);
}

.public-shell__step h3 {
    font-size: 1.2rem;
    margin: 0;
}

.public-shell__step p {
    margin: 0;
    color: var(--fm-text-secondary, rgba(15, 23, 42, 0.68));
    line-height: 1.6;
}

.public-shell__testimonial-deck {
    margin-top: 2rem;
    display: grid;
    gap: var(--public-shell-grid-gap);
}

.public-shell__testimonial-card {
    padding: 2rem;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.14), rgba(14, 116, 233, 0.08));
    backdrop-filter: blur(12px);
    box-shadow: 0 32px 60px rgba(15, 23, 42, 0.16);
}

.public-shell__testimonial-quote {
    font-size: 1.15rem;
    line-height: 1.7;
    font-weight: 500;
}

.public-shell__testimonial-author {
    margin-top: 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--fm-text-secondary, rgba(15, 23, 42, 0.72));
}

.public-shell__footer-cta {
    border-radius: 28px;
    padding: clamp(2.5rem, 5vw, 3.5rem);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(14, 165, 233, 0.18));
    box-shadow: 0 26px 48px rgba(14, 116, 233, 0.18);
    text-align: center;
}

.public-shell__footer-cta h2 {
    font-size: clamp(2rem, 3vw, 2.75rem);
    margin-bottom: 0.75rem;
}

.public-shell__footer-cta p {
    font-size: 1.05rem;
    color: var(--fm-text-secondary, rgba(15, 23, 42, 0.68));
    margin-bottom: 1.5rem;
}

/* Layout adjustments */
@media (min-width: 768px) {
    .public-shell__hero {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .public-shell__metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .public-shell__feature-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .public-shell__steps {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .public-shell__testimonial-deck {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .public-shell {
        padding-block: clamp(2rem, 8vw, 3rem);
    }

    .public-shell__cta-group {
        flex-direction: column;
        align-items: stretch;
    }

    .public-shell__logo-strip {
        grid-auto-flow: row;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* TODO (M1.2): component skins for pricing tiers, FAQ accordion, and newsletter capture */
