/* ═══════════════════════════════════════════════════════════
   Melk Applied — International real-estate collaboration
   Architectural luxury: deeper & more refined than HVAC/Shop
   Fonts: loaded once from templates/melk-page.php (do not @import —
   duplicate Google CSS blocked parse and doubled remote font downloads).
═══════════════════════════════════════════════════════════ */

:root {
    --ma-navy: #071525;
    --ma-ink: #0E1C2E;
    --ma-slate: #243447;
    --ma-muted: #6B7A8D;
    --ma-line: #D8E0EA;
    --ma-paper: #FFFFFF;
    --ma-mist: #F3F6FA;
    --ma-gold: #C9A24D;
    --ma-gold-soft: #F7F0DE;
    --ma-sky: #3A7CA5;
    --ma-shadow: 0 28px 70px rgba(7, 21, 37, .12);
    --ma-font: 'Vazirmatn', 'Outfit', system-ui, sans-serif;
    --ma-display: 'Cormorant Garamond', 'Vazirmatn', Georgia, serif;
    --ma-ui: 'Outfit', 'Vazirmatn', system-ui, sans-serif;
}

body.melk-body {
    margin: 0;
    background: var(--ma-paper);
    font-family: var(--ma-font);
    color: var(--ma-ink);
}

.melk-app.melk-app--landing.lp-wrap,
.melk-app.ma-applied {
    min-height: 100vh;
    background: var(--ma-paper);
    color: var(--ma-ink);
}

/* Override old purple landing when applied is present */
.ma-applied .melk-hero,
.ma-applied .em-portal-hero { display: none !important; }
.ma-applied .melk-features { display: none !important; }
.ma-applied .melk-header:not(.ma-header) { display: none !important; }

/* ── Utility ── */
.ma-util {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
    padding: 9px 48px;
    background: var(--ma-navy);
    color: rgba(255,255,255,.55);
    font-size: .74rem;
    letter-spacing: .02em;
}
.ma-util a {
    color: rgba(255,255,255,.62);
    text-decoration: none;
    transition: color .2s;
}
.ma-util a:hover { color: var(--ma-gold); }
.ma-util__gold { color: var(--ma-gold) !important; font-weight: 700; }

/* ── Header ── */
.ma-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px 32px;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid transparent;
    transition: box-shadow .3s, border-color .3s;
}
.ma-header--scrolled {
    box-shadow: 0 10px 40px rgba(7, 21, 37, .08);
    border-bottom-color: var(--ma-line);
}
.ma-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}
.ma-brand__mark {
    width: 36px; height: 36px;
    border-radius: 10px;
    background:
        linear-gradient(145deg, var(--ma-navy) 0%, var(--ma-slate) 60%, #1a3048 100%);
    color: var(--ma-gold);
    display: grid; place-items: center;
    font-family: var(--ma-display);
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 8px 20px rgba(7, 21, 37, .24);
    border: 1px solid rgba(201, 162, 77, .35);
}
.ma-brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.ma-brand__name {
    font-family: var(--ma-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -.02em;
}
.ma-brand__name em {
    font-style: italic;
    color: var(--ma-gold);
    font-weight: 600;
}
.ma-brand__sub {
    font-family: var(--ma-ui);
    font-size: .58rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ma-muted);
    font-weight: 600;
    margin-top: 2px;
}
.ma-nav {
    display: flex; align-items: center; gap: 2px;
    margin-right: auto;
}
.ma-nav a, .ma-nav button {
    color: var(--ma-ink);
    text-decoration: none;
    font-size: .84rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    background: none; border: none;
    cursor: pointer; font-family: inherit;
    transition: background .2s, color .2s;
}
.ma-nav a:hover, .ma-nav button:hover {
    background: var(--ma-mist);
    color: var(--ma-sky);
}
.ma-header__cta {
    display: inline-flex;
    padding: 8px 16px;
    background: var(--ma-navy);
    color: #fff !important;
    border: none; border-radius: 4px;
    font-weight: 700; font-size: .82rem;
    cursor: pointer; font-family: inherit;
    box-shadow: 0 8px 20px rgba(7, 21, 37, .22);
    transition: transform .2s, background .2s;
}
.ma-header__cta:hover {
    background: #0f2740;
    transform: translateY(-1px);
}
.ma-header__cta--gold {
    background: linear-gradient(135deg, #D4AF61, var(--ma-gold));
    color: var(--ma-navy) !important;
    box-shadow: 0 8px 20px rgba(201, 162, 77, .32);
}

/* ── Hero — compact landing band ── */
.ma-hero {
    position: relative;
    min-height: min(40vh, 320px);
    display: grid;
    align-content: end;
    overflow: hidden;
    background: var(--ma-navy);
}
.ma-hero__media {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(105deg, rgba(7,21,37,.88) 0%, rgba(7,21,37,.55) 42%, rgba(7,21,37,.25) 100%),
        linear-gradient(180deg, transparent 40%, rgba(7,21,37,.92) 100%),
        url('/acc-engine/assets/img/portals/melk/hero-skyline.jpg') center 30%/cover no-repeat;
}
.ma-hero__grain {
    position: absolute; inset: 0; pointer-events: none; z-index: 1;
    opacity: .04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.ma-hero__content {
    position: relative;
    z-index: 2;
    padding: 28px 48px 36px;
    max-width: 720px;
    animation: ma-rise 1s cubic-bezier(.22,1,.36,1) both;
}
@keyframes ma-rise {
    from { opacity: 0; transform: translateY(36px); }
    to   { opacity: 1; transform: none; }
}
.ma-hero__brand {
    font-family: var(--ma-display);
    font-size: clamp(1.35rem, 3vw, 2rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px;
    letter-spacing: -.03em;
    line-height: 1;
}
.ma-hero__brand span { color: var(--ma-gold); font-style: italic; }
.ma-hero h1 {
    margin: 0 0 8px;
    font-family: var(--ma-display);
    font-size: clamp(1.25rem, 2.8vw, 1.85rem);
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
    letter-spacing: -.02em;
}
.ma-hero h1 em {
    font-style: italic;
    color: var(--ma-gold);
}
.ma-hero__lead {
    margin: 0 0 16px;
    max-width: 480px;
    font-size: .92rem;
    line-height: 1.6;
    color: rgba(255,255,255,.72);
}
.ma-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ma-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px; border-radius: 4px;
    font-family: inherit; font-weight: 700; font-size: .88rem;
    cursor: pointer; border: none; text-decoration: none;
    transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
}
.ma-btn--gold {
    background: linear-gradient(135deg, #E0C070, var(--ma-gold));
    color: var(--ma-navy);
    box-shadow: 0 12px 32px rgba(201, 162, 77, .4);
}
.ma-btn--gold:hover { transform: translateY(-2px); }
.ma-btn--ghost {
    background: rgba(255,255,255,.08);
    color: #fff;
    border: 1px solid rgba(255,255,255,.35);
    backdrop-filter: blur(8px);
}
.ma-btn--ghost:hover {
    background: rgba(255,255,255,.16);
    transform: translateY(-2px);
}
.ma-btn--dark {
    background: var(--ma-navy);
    color: #fff;
}
.ma-btn--outline {
    background: transparent;
    color: var(--ma-ink);
    border: 1.5px solid var(--ma-line);
}
.ma-btn--outline:hover {
    border-color: var(--ma-sky);
    color: var(--ma-sky);
}

/* ── Sections ── */
.ma-section { padding: 80px 48px; }
.ma-section--mist { background: var(--ma-mist); }
.ma-section--navy {
    background: linear-gradient(160deg, #071525 0%, #12263a 55%, #071525 100%);
    color: #fff;
}
.ma-section__head { max-width: 700px; margin: 0 0 44px; }
.ma-kicker {
    display: inline-block;
    font-family: var(--ma-ui);
    font-size: .68rem; font-weight: 700;
    letter-spacing: .18em; text-transform: uppercase;
    color: var(--ma-gold); margin-bottom: 12px;
}
.ma-section--mist .ma-kicker,
.ma-section:not(.ma-section--navy) .ma-kicker { color: var(--ma-sky); }
.ma-section__head h2 {
    margin: 0 0 12px;
    font-family: var(--ma-display);
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.15;
}
.ma-section__head p {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--ma-muted);
}
.ma-section--navy .ma-section__head p { color: rgba(255,255,255,.65); }

/* Pillars */
.ma-pillars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border: 1px solid var(--ma-line);
    border-radius: 2px;
    overflow: hidden;
    background: #fff;
}
.ma-pillar {
    padding: 36px 28px;
    border-left: 1px solid var(--ma-line);
    transition: background .3s;
    position: relative;
}
.ma-pillar:first-child { border-left: none; }
.ma-pillar::before {
    content: '';
    position: absolute; top: 0; right: 0; left: 0; height: 3px;
    background: var(--ma-gold);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .35s ease;
}
.ma-pillar:hover { background: var(--ma-gold-soft); }
.ma-pillar:hover::before { transform: scaleX(1); }
.ma-pillar__num {
    font-family: var(--ma-display);
    font-size: 2rem;
    color: var(--ma-gold);
    font-weight: 700;
    display: block; margin-bottom: 12px;
}
.ma-pillar strong {
    display: block; margin-bottom: 8px;
    font-size: 1.1rem; font-weight: 700;
}
.ma-pillar span { font-size: .92rem; color: var(--ma-muted); line-height: 1.6; }

/* Stats band */
.ma-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}
.ma-stat { text-align: center; }
.ma-stat strong {
    display: block;
    font-family: var(--ma-display);
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    font-weight: 700;
    color: var(--ma-gold);
    letter-spacing: -.03em;
}
.ma-stat span {
    font-size: .88rem;
    color: rgba(255,255,255,.6);
    letter-spacing: .04em;
}

/* Access portals */
.ma-portals {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    max-width: 1180px;
    margin: 0 auto;
}
.ma-portal {
    display: flex; flex-direction: column; align-items: flex-start;
    gap: 8px; padding: 26px 22px;
    background: #fff;
    border: 1px solid var(--ma-line);
    border-radius: 2px;
    cursor: pointer; text-align: right;
    font-family: inherit; color: inherit;
    transition: border-color .25s, transform .25s, box-shadow .3s;
    position: relative; overflow: hidden;
}
.ma-portal::after {
    content: '';
    position: absolute; inset: auto 0 0 0; height: 2px;
    background: linear-gradient(90deg, var(--ma-gold), var(--ma-sky));
    transform: scaleX(0); transform-origin: right;
    transition: transform .35s;
}
.ma-portal:hover {
    border-color: var(--ma-sky);
    transform: translateY(-4px);
    box-shadow: var(--ma-shadow);
}
.ma-portal:hover::after { transform: scaleX(1); }
.ma-portal__tag {
    font-size: .65rem; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase;
    color: var(--ma-sky);
}
.ma-portal strong {
    font-size: 1.12rem; font-weight: 800;
    font-family: var(--ma-ui);
}
.ma-portal small {
    font-size: .86rem; color: var(--ma-muted); line-height: 1.5;
}
.ma-portal__go {
    margin-top: auto; padding-top: 12px;
    font-size: .84rem; font-weight: 700; color: var(--ma-navy);
}
.ma-portal--admin {
    background: linear-gradient(160deg, #071525, #12263a);
    color: #fff; border-color: transparent;
}
.ma-portal--admin .ma-portal__tag { color: var(--ma-gold); }
.ma-portal--admin small { color: rgba(255,255,255,.6); }
.ma-portal--admin strong { color: #fff; }
.ma-portal--admin .ma-portal__go { color: var(--ma-gold); }
.ma-portal--investor { background: linear-gradient(180deg, #fff 0%, #F7F0DE 100%); }
.ma-portal--advisory { background: linear-gradient(180deg, #fff 0%, #EEF5FA 100%); }

/* Story asymmetric */
.ma-story {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 0;
    max-width: 1180px;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid var(--ma-line);
}
.ma-story__media {
    min-height: 420px;
    background:
        linear-gradient(135deg, rgba(7,21,37,.35), rgba(58,124,165,.2)),
        url('/acc-engine/assets/img/portals/melk/story-home.jpg') center/cover;
}
.ma-story__body {
    padding: 48px 40px;
    display: flex; flex-direction: column; justify-content: center;
    background: #fff;
}
.ma-story__body h3 {
    margin: 0 0 14px;
    font-family: var(--ma-display);
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.25;
}
.ma-story__body p {
    margin: 0 0 24px;
    color: var(--ma-muted);
    line-height: 1.75;
    font-size: .98rem;
}

/* Help */
.ma-help {
    background: var(--ma-navy);
    color: #fff;
    padding: 56px 48px;
}
.ma-help__inner {
    max-width: 1180px; margin: 0 auto;
    display: flex; flex-wrap: wrap;
    align-items: center; justify-content: space-between; gap: 28px;
}
.ma-help h2 {
    margin: 0 0 8px;
    font-family: var(--ma-display);
    font-size: 1.9rem;
    font-weight: 700;
}
.ma-help p { margin: 0; color: rgba(255,255,255,.6); }
.ma-help__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ma-help__actions .ma-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,.28);
    color: #fff;
}
.ma-help__actions .ma-btn--solid {
    background: var(--ma-gold);
    border-color: var(--ma-gold);
    color: var(--ma-navy);
}

/* Demo panel polish */
.ma-applied .melk-demo-panel {
    position: relative;
    z-index: 50;
    border-bottom: 1px solid var(--ma-line);
    background: var(--ma-mist) !important;
}
.ma-applied .melk-demo-row {
    border-radius: 4px !important;
    border-color: var(--ma-line) !important;
}

/* Footer */
.ma-footer {
    padding: 28px 48px;
    background: #040b14;
    color: rgba(255,255,255,.4);
    font-size: .8rem;
    display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.ma-footer a { color: rgba(255,255,255,.55); text-decoration: none; }
.ma-footer a:hover { color: var(--ma-gold); }

/* Reveal */
.ma-reveal {
    opacity: 0; transform: translateY(28px);
    transition: opacity .8s ease, transform .8s ease;
}
.ma-reveal.is-in { opacity: 1; transform: none; }

/* Workspace header polish */
.melk-app--workspace .melk-header--app {
    background: var(--ma-navy) !important;
    border: none !important;
}
.melk-app--workspace .melk-brand {
    font-family: var(--ma-display) !important;
    font-weight: 700 !important;
    color: #fff !important;
}
.melk-app--workspace .red-hero.em-hero {
    background: linear-gradient(135deg, #071525, #1a3048) !important;
    border-radius: 4px !important;
}

/* Login */
.ma-login-screen { min-height: 100vh; background: var(--ma-mist); }
.ma-login {
    display: flex; justify-content: center; padding: 48px 20px 80px;
}
.ma-login__card {
    width: 100%; max-width: 420px;
    background: #fff;
    border: 1px solid var(--ma-line);
    padding: 36px 32px;
    box-shadow: var(--ma-shadow);
}
.ma-login__brand {
    margin: 0 0 16px;
    font-family: var(--ma-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--ma-navy);
}
.ma-login__brand em { font-style: italic; color: var(--ma-gold); }
.ma-login__role {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 12px; padding: 10px 12px;
    background: var(--ma-gold-soft);
    font-size: .9rem;
}
.ma-login__card h3 {
    margin: 0 0 8px;
    font-family: var(--ma-ui);
    font-size: 1.15rem;
}
.ma-login__hint { margin: 0 0 20px; color: var(--ma-muted); font-size: .88rem; line-height: 1.6; }

/* Login fields (was landing.css — kept local so unused purple landing sheet can stay off) */
.ma-login-screen .lp-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.ma-login-screen .lp-field label { font-size: .78rem; font-weight: 600; color: var(--ma-muted); }
.ma-login-screen .lp-field input {
    width: 100%; box-sizing: border-box;
    padding: 11px 12px; border: 1px solid var(--ma-line); border-radius: 8px;
    font: inherit; background: var(--ma-mist); color: var(--ma-ink);
}
.ma-login-screen .lp-field input:focus {
    outline: none; border-color: var(--ma-gold); background: #fff;
}
.ma-login-screen .lp-msg { font-size: .78rem; border-radius: 6px; padding: 8px 10px; margin-top: 10px; }
.ma-login-screen .lp-msg:empty { display: none; }
.ma-login-screen .lp-msg--error { background: #fee2e2; color: #991b1b; }

.ma-boot {
    min-height: 40vh;
    display: flex; align-items: center; justify-content: center;
    color: var(--ma-muted); font-size: .95rem; letter-spacing: .02em;
}

/* Workspace header */
.ma-ws-header {
    display: flex !important; align-items: center; gap: 20px;
    padding: 12px 28px !important;
}
.ma-brand--ws .ma-brand__mark {
    width: 36px; height: 36px; font-size: .95rem;
}
.ma-brand--ws .ma-brand__name { color: #fff !important; font-size: 1.05rem; }
.ma-brand--ws .ma-brand__sub { color: rgba(255,255,255,.45) !important; }
.ma-ws-user { color: rgba(255,255,255,.75) !important; font-size: .88rem; margin-inline-start: auto; }
.ma-ws-nav a { color: rgba(255,255,255,.7) !important; }
.ma-btn--ghost-light {
    background: transparent;
    border: 1px solid rgba(255,255,255,.3);
    color: #fff !important;
    padding: 8px 14px;
    border-radius: 2px;
    cursor: pointer;
    font-family: inherit;
}
.ma-btn--ghost-light:hover { border-color: var(--ma-gold); color: var(--ma-gold) !important; }

.em-main-tab--acct {
    border-bottom: 2px solid transparent !important;
}
.em-main-tab--acct.em-main-tab--active {
    border-bottom-color: var(--ma-gold) !important;
    color: var(--ma-navy) !important;
}

/* Accounting panel */
.ma-abc { padding: 8px 4px 32px; }
.ma-abc__head h2 {
    margin: 6px 0 8px;
    font-family: var(--ma-display);
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--ma-navy);
}
.ma-abc__head p { margin: 0; color: var(--ma-muted); font-size: .92rem; }
.ma-abc__toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 12px 0 16px; }
.ma-abc__toolbar label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ma-muted); }
.ma-abc__toolbar input, .ma-abc__toolbar select {
    padding: 8px 10px; border: 1px solid var(--ma-line); border-radius: 4px; min-width: 220px;
    font-family: inherit;
}
.ma-abc__kpis {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px;
}
.ma-abc__kpi {
    background: var(--ma-mist); border: 1px solid var(--ma-line);
    padding: 14px 16px; border-radius: 4px;
}
.ma-abc__kpi strong {
    display: block; font-size: 1.25rem; font-family: var(--ma-ui);
    color: var(--ma-navy); font-weight: 800;
}
.ma-abc__kpi span { font-size: .75rem; color: var(--ma-muted); }
.ma-abc__layout { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; }
.ma-abc__svg { width: 100%; height: auto; background: #f8fafc; border: 1px solid var(--ma-line); border-radius: 4px; }
.ma-abc__side {
    background: #fff; border: 1px solid var(--ma-line); padding: 16px; border-radius: 4px;
}
.ma-abc__side h3 {
    margin: 0 0 12px; font-size: .95rem; color: var(--ma-navy); font-family: var(--ma-ui);
}
.ma-abc__person, .ma-abc__act {
    display: flex; flex-direction: column; gap: 2px;
    padding: 10px 0; border-bottom: 1px solid var(--ma-line);
}
.ma-abc__person strong, .ma-abc__act b { font-size: .9rem; color: var(--ma-ink); }
.ma-abc__person small, .ma-abc__act small { color: var(--ma-muted); font-size: .75rem; }
.ma-abc__person span { font-weight: 700; color: var(--ma-gold); font-size: .88rem; margin-top: 4px; }
.ma-abc__muted { color: var(--ma-muted); font-size: .85rem; }
.ma-abc__table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: .82rem; }
.ma-abc__table th, .ma-abc__table td {
    padding: 8px 10px; border-bottom: 1px solid var(--ma-line); text-align: right;
}
.ma-abc__table th { background: var(--ma-mist); color: var(--ma-muted); font-weight: 700; }

@media (max-width: 1024px) {
    .ma-pillars, .ma-stats, .ma-portals { grid-template-columns: 1fr 1fr; }
    .ma-story { grid-template-columns: 1fr; }
    .ma-abc__layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .ma-util, .ma-nav { display: none; }
    .ma-header, .ma-section, .ma-help, .ma-hero__content, .ma-footer {
        padding-left: 20px; padding-right: 20px;
    }
    .ma-hero { min-height: min(32vh, 240px); }
    .ma-hero__content { padding-top: 20px; padding-bottom: 24px; }
    .ma-header { padding-top: 8px; padding-bottom: 8px; }
    .ma-pillars, .ma-stats, .ma-portals { grid-template-columns: 1fr; }
    .ma-pillar { border-left: none !important; border-top: 1px solid var(--ma-line); }
    .ma-pillar:first-child { border-top: none; }
}
