/* ==========================================================================
   Public pages — home (welcome) and login.
   Same indigo / violet language as the ERP (mc-theme.css), light + dark.
   ========================================================================== */

:root, [data-bs-theme="light"] {
    --p: #4f46e5;
    --p-rgb: 79, 70, 229;
    --p-600: #4338ca;
    --grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #f1f4fa;
    --border: #e4e8f1;
    --text: #151b2c;
    --muted: #5f6b82;
    --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 12px 32px -12px rgba(16, 24, 40, .14);
    --shadow-lg: 0 30px 80px -24px rgba(30, 27, 75, .35);
    --field: #ffffff;
    --logo-light: block; --logo-dark: none;
}
[data-bs-theme="dark"] {
    --p: #6366f1;
    --p-rgb: 99, 102, 241;
    --p-600: #4f46e5;
    --bg: #0b0f1a;
    --surface: #131a28;
    --surface-2: #19212f;
    --border: #232c3d;
    --text: #e8ecf5;
    --muted: #94a0b8;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 12px 32px -12px rgba(0, 0, 0, .5);
    --shadow-lg: 0 30px 80px -24px rgba(0, 0, 0, .7);
    --field: #0f1522;
    --logo-light: none; --logo-dark: block;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.mc-public {
    margin: 0;
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -.005em;
    line-height: 1.55;
}
.mc-public a { color: inherit; text-decoration: none; }
.mc-public img { max-width: 100%; }
.logo-for-light { display: var(--logo-light); }
.logo-for-dark { display: var(--logo-dark); }

/* shared buttons */
.pb {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 46px; padding: 0 22px;
    border-radius: 12px; border: 1px solid transparent;
    font-family: inherit; font-size: 14.5px; font-weight: 700; line-height: 1;
    cursor: pointer;
    transition: transform .15s, box-shadow .2s, background-color .15s, border-color .15s;
}
.pb:active { transform: translateY(1px); }
.pb-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 24px -8px rgba(var(--p-rgb), .7); }
.pb-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -8px rgba(var(--p-rgb), .8); color: #fff; }
.pb-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.pb-ghost:hover { border-color: rgba(var(--p-rgb), .5); color: var(--p); }
.pb-lg { height: 52px; padding: 0 28px; font-size: 15.5px; border-radius: 14px; }
.pb-block { width: 100%; }

.theme-btn {
    width: 40px; height: 40px; border-radius: 12px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px; cursor: pointer;
    transition: border-color .15s, color .15s;
}
.theme-btn:hover { border-color: rgba(var(--p-rgb), .5); color: var(--p); }
.theme-btn .t-sun { display: none; }
[data-bs-theme="dark"] .theme-btn .t-sun { display: inline; }
[data-bs-theme="dark"] .theme-btn .t-moon { display: none; }

/* ==========================================================================
   LOGIN
   ========================================================================== */
.auth-split { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); min-height: 100vh; }

.auth-brand {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 44px 56px;
    color: #fff;
    background:
        radial-gradient(600px 420px at 12% 8%, rgba(167, 139, 250, .55), transparent 65%),
        radial-gradient(560px 460px at 100% 90%, rgba(16, 185, 129, .38), transparent 65%),
        radial-gradient(500px 400px at 85% 10%, rgba(236, 72, 153, .28), transparent 65%),
        linear-gradient(160deg, #1b1f55 0%, #12163f 55%, #0b0e2a 100%);
}
.auth-brand::before {   /* dot grid */
    content: ""; position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px);
    background-size: 26px 26px;
    -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%);
    mask-image: linear-gradient(180deg, #000, transparent 85%);
    pointer-events: none;
}
.auth-brand > * { position: relative; }
.auth-brand .brand-logo { height: 44px; width: auto; }
.auth-hero h1 { font-size: clamp(30px, 3.2vw, 44px); line-height: 1.12; letter-spacing: -.03em; font-weight: 800; margin: 0 0 16px; max-width: 520px; }
.auth-hero h1 em { font-style: normal; background: linear-gradient(90deg, #a5b4fc, #6ee7b7); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-hero p { color: rgba(226, 232, 255, .78); font-size: 16px; max-width: 460px; margin: 0 0 30px; }
.auth-points { display: grid; gap: 12px; max-width: 470px; }
.auth-point {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .12);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.auth-point i {
    width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 19px; color: #fff;
    background: linear-gradient(160deg, var(--c1), var(--c2));
    box-shadow: 0 8px 18px -8px var(--c2);
}
.auth-point b { display: block; font-size: 14.5px; font-weight: 650; }
.auth-point span { font-size: 12.8px; color: rgba(226, 232, 255, .7); }
.auth-brand-foot { font-size: 12.5px; color: rgba(226, 232, 255, .55); }

.auth-panel { position: relative; display: flex; align-items: center; justify-content: center; padding: 40px 28px; background: var(--bg); }
.auth-panel .theme-btn { position: absolute; top: 20px; right: 20px; }
.auth-box { width: 100%; max-width: 410px; }
.auth-box .m-logo { height: 40px; width: auto; margin-bottom: 28px; display: none; }
.auth-box h2 { font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin: 0 0 6px; }
.auth-box .sub { color: var(--muted); margin: 0 0 28px; font-size: 15px; }

.f-group { margin-bottom: 18px; }
.f-label { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.f-label a { font-weight: 550; color: var(--p); }
.f-label a:hover { text-decoration: underline; }
.f-wrap { position: relative; }
.f-wrap > i.f-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--muted); pointer-events: none; }
.f-input {
    width: 100%; height: 50px;
    padding: 0 44px 0 44px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--field);
    color: var(--text);
    font-family: inherit; font-size: 15px; font-weight: 500;
    outline: 0;
    transition: border-color .15s, box-shadow .15s;
}
.f-input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.f-input:focus { border-color: rgba(var(--p-rgb), .65); box-shadow: 0 0 0 4px rgba(var(--p-rgb), .14); }
.f-input.is-invalid { border-color: #e11d48; }
.f-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.f-eye:hover { background: var(--surface-2); color: var(--text); }
.f-error { color: #e11d48; font-size: 12.8px; margin-top: 6px; }

.f-row { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 22px; font-size: 13.5px; }
.f-check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; color: var(--muted); user-select: none; }
.f-check input { width: 17px; height: 17px; accent-color: var(--p); }

.auth-note { margin-top: 26px; text-align: center; color: var(--muted); font-size: 14px; }
.auth-note a { color: var(--p); font-weight: 650; }
.auth-note a:hover { text-decoration: underline; }
.auth-alert { padding: 12px 14px; border-radius: 12px; font-size: 13.5px; margin-bottom: 18px; background: rgba(16, 185, 129, .12); color: #059669; border: 1px solid rgba(16, 185, 129, .3); }
.back-home { display: inline-flex; align-items: center; gap: 6px; margin-top: 22px; color: var(--muted); font-size: 13.5px; }
.back-home:hover { color: var(--p); }
.pb .spin { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: pbspin .7s linear infinite; display: none; }
.pb.is-busy .spin { display: inline-block; }
@keyframes pbspin { to { transform: rotate(360deg); } }

@media (max-width: 991.98px) {
    .auth-split { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-box .m-logo { display: block; }
    .auth-box .m-logo.logo-for-light { display: var(--logo-light); }
    .auth-box .m-logo.logo-for-dark { display: var(--logo-dark); }
}

/* ==========================================================================
   HOME
   ========================================================================== */
.home-wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }
.home-bg {
    position: absolute; inset: 0 0 auto 0; height: 760px; z-index: 0; pointer-events: none;
    background:
        radial-gradient(700px 420px at 15% 0%, rgba(124, 58, 237, .16), transparent 65%),
        radial-gradient(640px 420px at 90% 10%, rgba(16, 185, 129, .14), transparent 65%),
        radial-gradient(520px 360px at 55% 0%, rgba(79, 70, 229, .12), transparent 65%);
}
.home-root { position: relative; overflow: hidden; }
.home-root > * { position: relative; z-index: 1; }
.home-root > .home-bg { position: absolute; z-index: 0; }

.home-nav { display: flex; align-items: center; justify-content: space-between; height: 84px; }
.home-nav .brand img { height: 38px; width: auto; }
.home-links { display: flex; gap: 6px; }
.home-links a { padding: 9px 14px; border-radius: 10px; font-size: 14.5px; font-weight: 550; color: var(--muted); }
.home-links a:hover { color: var(--text); background: var(--surface-2); }
.home-actions { display: flex; align-items: center; gap: 10px; }
.home-actions .pb { height: 40px; padding: 0 18px; font-size: 14px; border-radius: 11px; }

.hero { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); gap: 56px; align-items: center; padding: 56px 0 90px; }
.pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px 6px 8px; margin-bottom: 22px;
    border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
    font-size: 13px; font-weight: 600; color: var(--muted);
}
.pill b { padding: 3px 10px; border-radius: 999px; background: var(--grad); color: #fff; font-size: 11.5px; letter-spacing: .02em; }
.hero h1 { font-size: clamp(36px, 4.6vw, 60px); line-height: 1.06; letter-spacing: -.04em; font-weight: 800; margin: 0 0 20px; }
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 520px; margin: 0 0 32px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13.5px; color: var(--muted); }
.hero-trust span { display: inline-flex; align-items: center; gap: 7px; }
.hero-trust i { color: #10b981; font-size: 17px; }

/* product mock */
.mock { position: relative; }
.mock-frame {
    border-radius: 20px; background: var(--surface); border: 1px solid var(--border);
    box-shadow: var(--shadow-lg); overflow: hidden;
    transform: perspective(1400px) rotateY(-7deg) rotateX(3deg);
    transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}
.mock:hover .mock-frame { transform: perspective(1400px) rotateY(-2deg) rotateX(1deg); }
.mock-bar { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.mock-bar i:nth-child(1) { background: #ff5f57; } .mock-bar i:nth-child(2) { background: #febc2e; } .mock-bar i:nth-child(3) { background: #28c840; }
.mock-body { display: grid; grid-template-columns: 62px 1fr; min-height: 340px; }
.mock-side { background: linear-gradient(180deg, #151a3a, #0b0e1f); padding: 14px 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.mock-side span { width: 28px; height: 28px; border-radius: 9px; background: linear-gradient(160deg, var(--c1), var(--c2)); opacity: .95; }
.mock-main { padding: 16px; display: grid; gap: 12px; align-content: start; }
.mock-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mock-stat { border-radius: 12px; padding: 12px; color: #fff; }
.mock-stat small { display: block; font-size: 10.5px; opacity: .85; font-weight: 600; }
.mock-stat i { display: block; height: 9px; width: 60%; margin-top: 10px; border-radius: 6px; background: rgba(255, 255, 255, .55); }
.mock-chart { border-radius: 12px; border: 1px solid var(--border); padding: 14px; background: var(--surface); display: flex; align-items: flex-end; gap: 9px; height: 130px; }
.mock-chart b { flex: 1; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #818cf8, #4f46e5); animation: grow 1.4s cubic-bezier(.2, .8, .2, 1) both; transform-origin: bottom; }
.mock-chart b:nth-child(even) { background: linear-gradient(180deg, #6ee7b7, #059669); }
@keyframes grow { from { transform: scaleY(.1); opacity: .3; } }
.mock-lines { display: grid; gap: 8px; }
.mock-lines i { display: block; height: 11px; border-radius: 6px; background: var(--surface-2); }
.mock-lines i:nth-child(2) { width: 82%; } .mock-lines i:nth-child(3) { width: 64%; }

.float-card {
    position: absolute; display: flex; align-items: center; gap: 11px;
    padding: 11px 15px 11px 11px; border-radius: 15px;
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
    font-size: 13px; font-weight: 650; white-space: nowrap;
    animation: floaty 6s ease-in-out infinite;
}
.float-card i { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 17px; background: linear-gradient(160deg, var(--c1), var(--c2)); }
.float-card small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.fc-1 { left: -34px; bottom: 56px; }
.fc-2 { right: -14px; top: 54px; animation-delay: -3s; }
@keyframes floaty { 50% { transform: translateY(-10px); } }

/* sections */
.section { padding: 84px 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }
.sec-head { text-align: center; max-width: 640px; margin: 0 auto 52px; }
.sec-head .eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--p); margin-bottom: 10px; }
.sec-head h2 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.12; letter-spacing: -.035em; font-weight: 800; margin: 0 0 14px; }
.sec-head p { color: var(--muted); font-size: 16.5px; margin: 0; }

.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feat {
    padding: 26px; border-radius: 20px;
    background: var(--surface); border: 1px solid var(--border);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.section-alt .feat { background: var(--bg); }
.feat:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(var(--p-rgb), .35); }
.feat .ico { width: 50px; height: 50px; border-radius: 15px; display: inline-flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; background: linear-gradient(160deg, var(--c1), var(--c2)); box-shadow: 0 12px 24px -10px var(--c2); margin-bottom: 18px; }
.feat h3 { font-size: 18px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 8px; }
.feat p { color: var(--muted); font-size: 14.8px; margin: 0; }

.split { display: grid; grid-template-columns: 1fr 1.05fr; gap: 60px; align-items: center; }
.split h2 { font-size: clamp(28px, 3.2vw, 38px); line-height: 1.12; letter-spacing: -.035em; font-weight: 800; margin: 0 0 16px; }
.split p { color: var(--muted); font-size: 16.5px; margin: 0 0 22px; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; font-size: 15.5px; }
.ticks li i { margin-top: 2px; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: rgba(16, 185, 129, .15); color: #059669; font-size: 14px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 18px; border-radius: 24px; background: var(--surface-2); border: 1px solid var(--border); }
.tile { border-radius: 16px; background: var(--surface); border: 1px solid var(--border); padding: 14px; box-shadow: var(--shadow); }
.tile:nth-child(3) { grid-column: 1 / -1; }
.tile-h { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.tile-h i { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; background: linear-gradient(160deg, var(--c1), var(--c2)); }
.tile .mock-lines i { background: var(--surface-2); }

.cta {
    border-radius: 28px; padding: 60px 32px; text-align: center; color: #fff;
    background:
        radial-gradient(500px 300px at 10% 0%, rgba(167, 139, 250, .5), transparent 65%),
        radial-gradient(500px 300px at 100% 100%, rgba(16, 185, 129, .35), transparent 65%),
        linear-gradient(135deg, #312e81, #1e1b4b);
    box-shadow: var(--shadow-lg);
}
.cta h2 { font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -.035em; font-weight: 800; margin: 0 0 12px; }
.cta p { color: rgba(226, 232, 255, .8); max-width: 520px; margin: 0 auto 28px; font-size: 16.5px; }
.cta .pb-light { background: #fff; color: #312e81; box-shadow: 0 12px 28px -10px rgba(0, 0, 0, .5); }
.cta .pb-light:hover { transform: translateY(-2px); }
.home-foot { padding: 40px 0 46px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; }
.home-foot img { height: 30px; width: auto; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 991.98px) {
    .hero, .split { grid-template-columns: 1fr; gap: 44px; }
    .hero { padding: 24px 0 64px; }
    .feat-grid { grid-template-columns: repeat(2, 1fr); }
    .home-links { display: none; }
    .mock-frame { transform: none; }
    .fc-1 { left: 8px; } .fc-2 { right: 8px; }
}
@media (max-width: 575.98px) {
    .feat-grid { grid-template-columns: 1fr; }
    .home-wrap { padding: 0 18px; }
    .home-actions .pb-ghost { display: none; }
    .float-card { display: none; }
    .section { padding: 60px 0; }
}
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .float-card, .mock-chart b { animation: none; }
    .mock-frame { transition: none; }
}

.home-actions .pb { white-space: nowrap; }
@media (max-width: 575.98px) {
    .hide-sm { display: none; }
    .home-nav .brand img { height: 30px; }
    .home-actions { gap: 8px; }
}

/* Primary buttons: always white text (beats the generic ".mc-public a" colour) */
.mc-public .pb-primary, .mc-public .pb-primary:hover, .mc-public .pb-primary:focus, .mc-public .pb-primary i, .mc-public .pb-primary span { color: #fff; }
