/**
 * Medica Home — App download landing
 * DNA tokens: Healthcare Luxury Minimalism, RTL, Cairo, 8pt grid
 */

:root {
    --mh-primary: #0F766E;
    --mh-primary-light: #14B8A6;
    --mh-primary-dark: #0D5F58;
    --mh-primary-soft: #CCFBF1;
    --mh-bg: #F8FAFC;
    --mh-surface: #FFFFFF;
    --mh-text: #0F172A;
    --mh-text-secondary: #64748B;
    --mh-success: #10B981;
    --mh-border: #E2E8F0;
    --mh-whatsapp: #128C7E;
    --mh-space-xs: 8px;
    --mh-space-sm: 16px;
    --mh-space-md: 24px;
    --mh-space-lg: 32px;
    --mh-space-xl: 48px;
    --mh-space-2xl: 64px;
    --mh-space-3xl: 80px;
    --mh-radius-btn: 16px;
    --mh-radius-card: 20px;
    --mh-radius-sheet: 28px;
    --mh-touch: 56px;
    --mh-header: 72px;
    --mh-sticky: 80px;
    --mh-max: 1120px;
    --mh-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    --mh-shadow-lg: 0 16px 40px rgba(15, 118, 110, 0.12);
    --mh-ease: 250ms ease;
}

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

html {
    scroll-behavior: smooth;
}

body.dl-body {
    margin: 0;
    font-family: 'Cairo', sans-serif;
    background: var(--mh-bg);
    color: var(--mh-text);
    line-height: 1.7;
    padding-bottom: calc(var(--mh-sticky) + 16px);
}

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

a {
    color: inherit;
}

.dl-skip {
    position: absolute;
    inset-inline-start: -999px;
    top: 8px;
    background: var(--mh-primary);
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    z-index: 100;
}

.dl-skip:focus {
    inset-inline-start: 8px;
}

.dl-wrap {
    width: min(100% - 32px, var(--mh-max));
    margin-inline: auto;
}

/* Header */

.dl-header {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--mh-header);
    background: rgba(248, 250, 252, 0.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--mh-border);
}

.dl-header__inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--mh-space-sm);
}

.dl-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.dl-brand img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.dl-brand__name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--mh-text);
}

.dl-header__call {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 14px;
    background: var(--mh-surface);
    border: 1px solid var(--mh-border);
    color: var(--mh-primary);
    font-weight: 600;
    text-decoration: none;
    transition: background var(--mh-ease);
}

.dl-header__call:hover {
    background: var(--mh-primary-soft);
}

/* Hero */

.dl-hero {
    padding: var(--mh-space-xl) 0 var(--mh-space-2xl);
}

.dl-hero__grid {
    display: grid;
    gap: var(--mh-space-xl);
    align-items: center;
}

.dl-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--mh-primary-soft);
    color: var(--mh-primary-dark);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: var(--mh-space-sm);
}

.dl-eyebrow__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mh-success);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.dl-hero h1 {
    margin: 0 0 var(--mh-space-sm);
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    line-height: 1.35;
    color: var(--mh-text);
}

.dl-hero h1 em {
    font-style: normal;
    color: var(--mh-primary);
}

.dl-lead {
    margin: 0 0 var(--mh-space-lg);
    font-size: 1.125rem;
    color: var(--mh-text-secondary);
    max-width: 36rem;
}

.dl-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: var(--mh-space-lg);
}

.dl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: var(--mh-touch);
    padding: 0 24px;
    border-radius: var(--mh-radius-btn);
    font-family: inherit;
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    border: 2px solid transparent;
    transition: background var(--mh-ease), transform var(--mh-ease), box-shadow var(--mh-ease);
    cursor: pointer;
}

.dl-btn:active {
    transform: scale(0.98);
}

.dl-btn--primary {
    background: var(--mh-primary);
    color: #fff;
    box-shadow: 0 8px 24px rgba(15, 118, 110, 0.28);
}

.dl-btn--primary:hover {
    background: var(--mh-primary-dark);
    color: #fff;
}

.dl-btn--ghost {
    background: var(--mh-surface);
    color: var(--mh-primary);
    border-color: var(--mh-primary);
}

.dl-btn--ghost:hover {
    background: rgba(15, 118, 110, 0.08);
}

.dl-btn--whatsapp {
    background: var(--mh-whatsapp);
    color: #fff;
}

.dl-btn--full {
    width: 100%;
}

.dl-proof {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    padding: 0;
    margin: 0;
    list-style: none;
    color: var(--mh-text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
}

.dl-proof li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dl-proof i {
    color: var(--mh-primary);
}

/* Phone mockup */

.dl-phone {
    width: min(280px, 100%);
    margin-inline: auto;
    background: #0F172A;
    border-radius: 36px;
    padding: 12px;
    box-shadow: var(--mh-shadow-lg);
}

.dl-phone__screen {
    background: var(--mh-bg);
    border-radius: 26px;
    overflow: hidden;
    min-height: 460px;
}

.dl-phone__bar {
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dl-phone__notch {
    width: 88px;
    height: 10px;
    background: #0F172A;
    border-radius: 999px;
}

.dl-phone__app {
    padding: 8px 16px 20px;
}

.dl-phone__brand {
    font-weight: 700;
    color: var(--mh-primary);
    font-size: 0.85rem;
}

.dl-phone__hello {
    margin: 4px 0 16px;
    font-size: 1.15rem;
    font-weight: 700;
}

.dl-phone__row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--mh-surface);
    border: 1px solid var(--mh-border);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 10px;
}

.dl-phone__icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--mh-primary-soft);
    color: var(--mh-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dl-phone__row strong {
    display: block;
    font-size: 0.9rem;
}

.dl-phone__row span {
    font-size: 0.75rem;
    color: var(--mh-text-secondary);
}

.dl-phone__cta {
    margin-top: 16px;
    background: var(--mh-primary);
    color: #fff;
    border-radius: 14px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Trust */

.dl-trust {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 0 0 var(--mh-space-2xl);
}

.dl-trust__item {
    background: var(--mh-surface);
    border: 1px solid var(--mh-border);
    border-radius: var(--mh-radius-card);
    padding: var(--mh-space-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--mh-shadow);
}

.dl-trust__item i {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--mh-primary-soft);
    color: var(--mh-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dl-trust__item span {
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.4;
}

/* Sections */

.dl-section {
    padding: var(--mh-space-xl) 0;
}

.dl-section--surface {
    background: var(--mh-surface);
    border-block: 1px solid var(--mh-border);
}

.dl-kicker {
    margin: 0 0 8px;
    color: var(--mh-primary);
    font-weight: 700;
    font-size: 0.9rem;
}

.dl-section h2 {
    margin: 0 0 8px;
    font-size: clamp(1.4rem, 3vw, 2rem);
    line-height: 1.35;
}

.dl-section__lead {
    margin: 0 0 var(--mh-space-lg);
    color: var(--mh-text-secondary);
    max-width: 36rem;
}

.dl-services {
    display: grid;
    gap: 16px;
}

.dl-service {
    background: var(--mh-surface);
    border: 1px solid var(--mh-border);
    border-radius: var(--mh-radius-card);
    overflow: hidden;
    box-shadow: var(--mh-shadow);
    display: flex;
    flex-direction: column;
}

.dl-service__media {
    height: 140px;
    background: linear-gradient(145deg, #0F766E, #14B8A6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    position: relative;
    overflow: hidden;
}

.dl-service__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}

.dl-service__media:has(img) i {
    display: none;
}

.dl-service__body {
    padding: var(--mh-space-sm);
    flex: 1;
}

.dl-service h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
}

.dl-service p {
    margin: 0;
    color: var(--mh-text-secondary);
    font-size: 0.92rem;
}

/* Steps */

.dl-steps {
    display: grid;
    gap: 16px;
}

.dl-step {
    background: var(--mh-bg);
    border-radius: var(--mh-radius-card);
    padding: var(--mh-space-md);
    border: 1px solid var(--mh-border);
}

.dl-step__num {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--mh-primary);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.dl-step h3 {
    margin: 0 0 6px;
    font-size: 1.1rem;
}

.dl-step p {
    margin: 0;
    color: var(--mh-text-secondary);
}

/* Download cards */

.dl-stores {
    display: grid;
    gap: 16px;
}

.dl-store {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--mh-bg);
    border: 2px solid var(--mh-border);
    border-radius: var(--mh-radius-card);
    padding: 16px;
    text-decoration: none;
    min-height: 88px;
    transition: border-color var(--mh-ease), transform var(--mh-ease), box-shadow var(--mh-ease);
}

.dl-store:hover {
    border-color: var(--mh-primary);
    box-shadow: var(--mh-shadow);
}

.dl-store.is-preferred {
    border-color: var(--mh-primary);
    background: #F0FDFA;
}

.dl-store__icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    flex-shrink: 0;
}

.dl-store__icon--android { background: #3DDC84; }
.dl-store__icon--ios { background: #0F172A; }
.dl-store__icon--apk { background: var(--mh-primary); }

.dl-store strong {
    display: block;
    font-size: 1.05rem;
}

.dl-store span {
    color: var(--mh-text-secondary);
    font-size: 0.9rem;
}

.dl-store i.fa-chevron-left {
    margin-inline-start: auto;
    color: var(--mh-text-secondary);
}

.dl-note {
    margin-top: var(--mh-space-md);
    color: var(--mh-text-secondary);
    font-size: 0.95rem;
}

/* Contact */

.dl-contact {
    display: grid;
    gap: 12px;
}

.dl-contact a,
.dl-contact .dl-contact__static {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--mh-surface);
    border: 1px solid var(--mh-border);
    border-radius: var(--mh-radius-card);
    padding: 16px;
    text-decoration: none;
    min-height: 64px;
    box-shadow: var(--mh-shadow);
}

.dl-contact a:hover {
    border-color: var(--mh-primary);
}

.dl-contact__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mh-primary-soft);
    color: var(--mh-primary);
    flex-shrink: 0;
}

.dl-contact a[href*="wa.me"] .dl-contact__icon {
    background: #DCFCE7;
    color: var(--mh-whatsapp);
}

.dl-contact small {
    display: block;
    color: var(--mh-text-secondary);
    font-size: 0.8rem;
}

.dl-contact strong {
    font-size: 1rem;
}

.dl-social {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: var(--mh-space-md);
}

.dl-social a {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mh-surface);
    border: 1px solid var(--mh-border);
    color: var(--mh-text);
    text-decoration: none;
    font-size: 1.15rem;
    transition: background var(--mh-ease), color var(--mh-ease);
}

.dl-social a:hover {
    background: var(--mh-primary);
    color: #fff;
    border-color: var(--mh-primary);
}

/* Footer + sticky */

.dl-footer {
    padding: var(--mh-space-xl) 0 var(--mh-space-md);
    color: var(--mh-text-secondary);
    font-size: 0.9rem;
}

.dl-footer__brand {
    font-weight: 700;
    color: var(--mh-text);
    margin-bottom: 8px;
}

.dl-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 16px 0;
}

.dl-footer nav a {
    text-decoration: none;
    font-weight: 600;
}

.dl-footer nav a:hover {
    color: var(--mh-primary);
}

.dl-sticky {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--mh-border);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}

.dl-sticky .dl-wrap {
    width: 100%;
}

@media (min-width: 768px) {
    body.dl-body {
        padding-bottom: 0;
    }

    .dl-hero__grid {
        grid-template-columns: 1.1fr 0.9fr;
        gap: var(--mh-space-2xl);
    }

    .dl-trust {
        grid-template-columns: repeat(4, 1fr);
    }

    .dl-services {
        grid-template-columns: repeat(3, 1fr);
    }

    .dl-steps {
        grid-template-columns: repeat(3, 1fr);
    }

    .dl-stores {
        grid-template-columns: repeat(3, 1fr);
    }

    .dl-contact {
        grid-template-columns: repeat(2, 1fr);
    }

    .dl-sticky {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}
