/* ============================================================================
   Medical Engines — landing page. Responsive, mobile-first.
   Palette sampled from the Figma design:
     light pink card   #FFD9E0
     strong pink card  #F49DB5
     accent / deep rose #C9445F
   Typeface: VAG Rounded (per the Figma).
   ========================================================================== */

@font-face {
    font-family: "VAG Rounded";
    src: url("/graphics/fonts/VAGRoundedRegular.ttf") format("truetype");
    font-weight: 400 800;   /* only Regular ships; bold weights are synthesized */
    font-style: normal;
    font-display: swap;
}

:root {
    /* Rounded fallbacks keep the look if VAG Rounded fails to load. */
    --font: "VAG Rounded", "Trebuchet MS", "Segoe UI", system-ui, -apple-system, sans-serif;
    --pink-light: #FFD9E0;
    --pink-strong: #F49DB5;
    --rose: #C9445F;
    --ink: #1a1a1a;
    --max-width: 1200px;
    --radius: 6px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    line-height: 1.5;
}

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

/* ------------------------------- Buttons -------------------------------- */
.btn {
    display: inline-block;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.85rem;
    padding: 0.7rem 2.2rem;
    border-radius: 999px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    cursor: pointer;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,0.18); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.btn--light {
    background: #fff;
    color: var(--rose);
}

.btn--rose {
    background: var(--rose);
    color: #fff;
}

.link-btn {
    background: none;
    border: none;
    font: inherit;
    font-weight: 600;
    font-size: 1.4rem;
    color: var(--rose);
    cursor: pointer;
    padding: 0;
}

.link-btn--light { 
    color: #fff;
}

/* -------------------------------- Hero ---------------------------------- */
.hero {
    position: relative;
    min-height: clamp(320px, 42vw, 460px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4.5rem 1.25rem 3rem;
    color: #fff;
    text-align: center;
    background-image:
        linear-gradient(rgba(120, 40, 70, 0.35), rgba(120, 40, 70, 0.45)),
        url("/graphics/images/medical_engines/hero.jpg");
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.hero__logo {
    position: absolute;
    top: 1.1rem;
    left: 1.4rem;
    width: clamp(58px, 7vw, 88px);
}
/* The logo art is black line work; render it white over the dark hero. */
.hero__logo img { filter: brightness(0) invert(1); }

.hero__auth {
    position: absolute;
    top: 1.4rem;
    right: 1.4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1;
}

.hero__content { max-width: 720px; }

.hero__title {
    margin: 0 0 0.6rem;
    font-size: clamp(2.1rem, 5vw, 3.4rem);
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

.hero__subtitle {
    margin: 0 auto 1.8rem;
    max-width: 38ch;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    text-shadow: 0 1px 6px rgba(0,0,0,0.35);
}

/* ------------------------------ Sections -------------------------------- */
.section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: clamp(2.5rem, 6vw, 4.5rem) 1.25rem 0;
}
main > .section:last-child { padding-bottom: clamp(2.5rem, 6vw, 4.5rem); }

.section__title {
    text-align: center;
    margin: 0 0 clamp(1.8rem, 4vw, 2.8rem);
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 800;
}

/* -------------------------------- Cards --------------------------------- */
.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(1.25rem, 3vw, 2.25rem);
}

.card {
    border-radius: var(--radius);
    padding: clamp(1.5rem, 3vw, 2.25rem) 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(201, 68, 95, 0.22); }

.card--light  { background: var(--pink-light); }
.card--strong { background: var(--pink-strong); }

.card__icon {
    width: clamp(46px, 6vw, 64px);
    height: clamp(46px, 6vw, 64px);
    object-fit: contain;
    margin-bottom: 1.1rem;
}

.card__title {
    margin: 0 0 0.6rem;
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    font-weight: 600;
}

.card__text {
    margin: 0;
    max-width: 26ch;
    font-size: 0.95rem;
    color: #2a2a2a;
}

/* --------------------------------- CTA ---------------------------------- */
.cta {
    margin-top: clamp(2.5rem, 6vw, 4.5rem);
    padding: clamp(2.2rem, 5vw, 3.2rem) 1.25rem;
    text-align: center;
    color: #fff;
    /* Figma footer gradient: dark maroon -> magenta -> orange -> soft pink -> mauve */
    background: linear-gradient(90deg,
        #4B3928 0%,
        #803043 12%,
        #B6275F 24%,
        #CA2B64 34%,
        #CA8546 60%,
        #D58D78 72%,
        #D88DA7 82%,
        #A97986 92%,
        #896C70 100%);
}

.cta__title {
    margin: 0 0 1.4rem;
    font-size: clamp(1.15rem, 2.6vw, 1.6rem);
    font-weight: 600;
    text-shadow: 0 1px 6px rgba(0,0,0,0.25);
}

/* ------------------------------ Responsive ------------------------------ */
@media (max-width: 860px) {
    .cards { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; }
}

@media (max-width: 520px) {
    .hero { padding-top: 5.5rem; }
    .hero__logo { top: 0.9rem; left: 1rem; }
    .btn { padding: 0.65rem 1.8rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .btn, .card { transition: none; }
}

/* ---------------------------- Auth modals -------------------------------- */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 26, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    z-index: 1000;
}
.auth-overlay[hidden] { display: none; }

.auth-modal {
    position: relative;
    width: 100%;
    max-width: 360px;
    background: #fff;
    border-radius: var(--radius);
    padding: 2.25rem 1.75rem 1.75rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.auth-modal__close {
    position: absolute;
    top: 0.6rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0.25rem;
}
.auth-modal__close:hover { color: var(--ink); }

.auth-modal__title {
    margin: 0 0 1.4rem;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--ink);
}

.auth-form { display: flex; flex-direction: column; }

.auth-form__label {
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0.75rem 0 0.35rem;
    color: var(--ink);
}
.auth-form__label:first-of-type { margin-top: 0; }

.auth-form__field { position: relative; }

.auth-form__input {
    width: 100%;
    font: inherit;
    padding: 0.65rem 2.4rem 0.65rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: var(--ink);
}
.auth-form__input:focus {
    outline: none;
    border-color: var(--rose);
    box-shadow: 0 0 0 3px rgba(201, 68, 95, 0.15);
}

.auth-form__input[type="password"] {
    font-family: Verdana, "Segoe UI", system-ui, sans-serif;
}

.auth-form__icon {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    color: #aaa;
    pointer-events: none;
}

.auth-form__message {
    min-height: 1.2em;
    margin-top: 0.85rem;
    font-size: 0.85rem;
}
.auth-form__message--error { color: #b3261e; }
.auth-form__message--success { color: #1e7a3d; }

.auth-form__submit {
    margin-top: 1rem;
    align-self: center;
    color: #fff;
    border: none;
}

.auth-modal__switch {
    margin: 1rem 0 0;
    text-align: center;
    font-size: 0.85rem;
    color: #555;
}

.font-normal-1 {
    font-size: 1rem;
}

/* ---------------------------- Profile menu -------------------------------- */
.profile-menu { position: relative; }

.profile-menu__trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #fff;
    cursor: pointer;
    padding: 0;
}
.profile-menu__trigger:hover { background: rgba(255, 255, 255, 0.3); }

.profile-menu__dropdown {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    min-width: 220px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    padding: 1rem 1.1rem;
    text-align: left;
    z-index: 5;
}

.profile-menu__label {
    margin: 0;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #888;
}

.profile-menu__email {
    margin: 0.25rem 0 0.85rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
    word-break: break-all;
}

.profile-menu__logout {
    display: block;
    width: 100%;
    background: none;
    border: none;
    border-top: 1px solid #eee;
    padding: 0.65rem 0 0;
    font: inherit;
    font-weight: 600;
    color: var(--rose);
    cursor: pointer;
    text-align: left;
}
.profile-menu__logout:hover { text-decoration: underline; }

/* ------------------------------ Logo menu ---------------------------------- */
.logo-menu__link { display: block; }

.logo-menu__dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 160px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
    padding: 0.4rem;
    text-align: left;
    z-index: 10;
}

.logo-menu__item {
    display: block;
    padding: 0.55rem 0.75rem;
    border-radius: 4px;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: normal;
    color: var(--ink);
    text-align: left;
    text-decoration: none;
    text-transform: none;
    white-space: nowrap;
}
.logo-menu__item:hover { background: var(--pink-light); color: var(--rose); }
