html {
    font-size: 14px;
    scroll-behavior: smooth;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --app-header-h: 72px;
    --app-footer-h-compact: 34px;
    --app-bg: #f5f7fb;
    --app-surface: #ffffff;
    --app-surface-soft: #f8fafc;
    --app-text: #1f2a44;
    --app-text-soft: #7b8794;
    --app-border: #e6ebf2;
    --app-nav: #1b2f6b;
    --app-nav-dark: #16285c;
    --app-primary: #2f64f5;
    --app-primary-dark: #2554d9;
    --app-tag-bg: #dce7ff;
    --app-tag-text: #2f64f5;
    --app-card-header-left: #2c63d8;
    --app-card-header-right: #137a7f;
    --app-shadow-sm: 0 8px 24px rgba(16, 24, 40, 0.06);
    --app-shadow-md: 0 10px 30px rgba(16, 24, 40, 0.08);
    --app-radius-sm: 12px;
    --app-radius-md: 18px;
    --app-radius-lg: 22px;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

    body.app-shell {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        background: var(--app-bg);
        color: var(--app-text);
        font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
        line-height: 1.6;
    }

        body.app-shell.mapcad-page {
            height: 100dvh;
            min-height: 100dvh;
            overflow: hidden;
        }

.app-container {
    max-width: 1240px;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 3000;
}

.app-navbar {
    min-height: var(--app-header-h);
    background: linear-gradient(90deg, var(--app-nav-dark) 0%, var(--app-nav) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.10);
}

.navbar-brand {
    color: #ffffff !important;
    text-decoration: none;
    letter-spacing: 0.01em;
}

.brand-badge {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.brand-text {
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 700;
}

.brand-subtext {
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.app-nav-list {
    gap: 0.15rem;
}

.navbar .nav-link {
    color: rgba(255, 255, 255, 0.90) !important;
    font-weight: 600;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    transition: background 0.2s ease, color 0.2s ease;
    position: relative;
}

    .navbar .nav-link:hover,
    .navbar .nav-link:focus,
    .navbar .nav-link.active {
        color: #ffffff !important;
    }

        .navbar .nav-link.active::after {
            content: "";
            position: absolute;
            left: 0.9rem;
            right: 0.9rem;
            bottom: 0.25rem;
            height: 2px;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.95);
        }

.app-navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    padding: 0.4rem 0.65rem;
}

.navbar-toggler {
    color: #ffffff;
}

.navbar-toggler-icon {
    filter: brightness(0) invert(1);
}

.navbar-toggler:focus,
.btn:focus,
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(47, 100, 245, 0.14);
}

.app-dropdown-menu,
.dropdown-menu {
    border: 1px solid var(--app-border);
    border-radius: 14px;
    box-shadow: var(--app-shadow-md);
    padding: 0.45rem;
}

.dropdown-item {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.55rem 0.8rem;
    color: var(--app-text);
}

    .dropdown-item:hover,
    .dropdown-item:focus,
    .dropdown-item.active,
    .dropdown-item:active {
        background: #f3f7ff;
        color: var(--app-primary-dark);
    }

.app-nav-actions .btn {
    min-width: 136px;
}

.app-main {
    flex: 1 0 auto;
    width: 100%;
    min-height: 0;
}

.app-main-mapcad {
    overflow: hidden;
}

.app-footer {
    flex-shrink: 0;
    margin-top: auto;
    background: #ffffff;
    border-top: 1px solid var(--app-border);
}

    .app-footer a {
        color: var(--app-primary);
        font-weight: 600;
        text-decoration: none;
    }

        .app-footer a:hover {
            color: var(--app-primary-dark);
        }

.footer-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--app-text);
    margin-bottom: 0.3rem;
}

.footer-text {
    max-width: 520px;
}

.footer-heading {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8a94a6;
    margin-bottom: 0.35rem;
}

.footer-links {
    line-height: 1.1;
}

    .footer-links a {
        padding: 0 !important;
        line-height: 1.1;
    }

.app-footer .small {
    line-height: 1.2;
}

.footer-contact-email {
    color: var(--app-primary) !important;
    font-weight: 500;
    line-height: 1.1;
}

    .footer-contact-email:hover {
        color: var(--app-primary-dark) !important;
    }

.app-footer-compact {
    min-height: 30px;
    display: flex;
    align-items: center;
    background: #ffffff;
}

    .app-footer-compact .container-fluid {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .app-footer-compact .d-flex {
        min-height: 34px;
        align-items: center !important;
    }

    .app-footer-compact .small {
        font-size: 0.76rem;
        line-height: 1;
        margin: 0;
    }

    .app-footer-compact a {
        line-height: 1;
        padding: 0;
    }

    .app-footer-compact .text-muted {
        line-height: 1;
        margin: 0;
    }

a {
    color: var(--app-primary);
    transition: color 0.2s ease;
}

    a:hover {
        color: var(--app-primary-dark);
    }

img {
    max-width: 100%;
    height: auto;
}

.text-muted {
    color: var(--app-text-soft) !important;
}

.border-top {
    border-top: 1px solid var(--app-border) !important;
}

.border-bottom {
    border-bottom: 1px solid var(--app-border) !important;
}

.box-shadow {
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}

button.accept-policy {
    font-size: 1rem;
    line-height: inherit;
}

.btn {
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    min-height: 44px;
    padding: 0.68rem 1rem;
}

.btn-primary,
.app-btn-main {
    background: var(--app-primary);
    border: 1px solid var(--app-primary);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(47, 100, 245, 0.20);
}

    .btn-primary:hover,
    .btn-primary:focus,
    .app-btn-main:hover,
    .app-btn-main:focus {
        background: var(--app-primary-dark);
        border-color: var(--app-primary-dark);
        color: #ffffff;
    }

.btn-outline-primary,
.app-btn-ghost {
    border-color: rgba(255, 255, 255, 0.70);
    color: #ffffff;
    background: transparent;
}

    .btn-outline-primary:hover,
    .btn-outline-primary:focus,
    .app-btn-ghost:hover,
    .app-btn-ghost:focus {
        background: rgba(255, 255, 255, 0.10);
        border-color: #ffffff;
        color: #ffffff;
    }

.app-main .btn-outline-primary {
    background: #ffffff;
    color: var(--app-primary);
    border-color: var(--app-primary);
}

    .app-main .btn-outline-primary:hover,
    .app-main .btn-outline-primary:focus {
        background: #f5f8ff;
        color: var(--app-primary-dark);
        border-color: var(--app-primary-dark);
    }

.btn-outline-secondary {
    border-color: #d7dee8;
    color: #4a5568;
    background: #ffffff;
}

    .btn-outline-secondary:hover,
    .btn-outline-secondary:focus {
        background: #f7f9fc;
        color: var(--app-text);
        border-color: #d7dee8;
    }

.btn-outline-danger {
    border-color: #f1b3b3;
    color: #b42318;
}

    .btn-outline-danger:hover,
    .btn-outline-danger:focus {
        background: #fff5f5;
        color: #912018;
        border-color: #f1b3b3;
    }

.form-control,
.form-select {
    border-radius: 12px;
    border: 1px solid #d9e1ec;
    min-height: 46px;
    color: var(--app-text);
    background-color: #ffffff;
    box-shadow: none;
}

    .form-control::placeholder,
    textarea::placeholder {
        color: #9aa5b1;
    }

textarea.form-control {
    min-height: 120px;
}

.app-card,
.product-card,
.summary-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 18px;
    box-shadow: var(--app-shadow-sm);
    overflow: hidden;
}

.product-card-header,
.app-card-header {
    padding: 1rem 1.2rem;
    border-bottom: none;
}

.product-card-header {
    background: linear-gradient(90deg, var(--app-card-header-left) 0%, var(--app-card-header-right) 100%);
    color: #ffffff;
    font-weight: 700;
}

.app-card-header {
    background: linear-gradient(90deg, #2c63d8 0%, #2554d9 100%);
    color: #ffffff;
}

.app-card-title {
    margin: 0;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
}

.product-card-body,
.summary-card,
.app-card-body {
    padding: 1.2rem;
}

.feature-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #edf1f6;
    font-weight: 500;
    color: var(--app-text);
}

    .feature-item:last-child {
        border-bottom: none;
    }

.landing-page .hero-section {
    background: linear-gradient(90deg, #f6f8fc 0%, #f2f5fa 100%);
    border-bottom: 1px solid var(--app-border);
}

.hero-tag {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: var(--app-tag-bg);
    color: var(--app-tag-text);
    font-weight: 600;
    font-size: 0.88rem;
}

.hero-title {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.12;
    font-weight: 700;
    color: var(--app-text);
    max-width: 760px;
}

.hero-description {
    font-size: 1.03rem;
    max-width: 760px;
    color: var(--app-text-soft);
}

.hero-actions .btn {
    min-width: 170px;
}

.privacy-page,
.legal-page,
.disc-page,
.sd-page {
    min-height: auto !important;
    padding: 2rem 0 3rem;
}

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    white-space: nowrap;
    line-height: 60px;
}

@media (max-width: 991.98px) {
    :root {
        --app-header-h: 66px;
        --app-footer-h-compact: 34px;
    }

    .app-navbar {
        min-height: auto;
    }

    .navbar .nav-link.active::after {
        display: none;
    }

    .navbar-collapse {
        margin-top: 1rem;
        padding: 1rem;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.12);
    }

    .app-nav-actions {
        margin-top: 1rem;
        width: 100%;
        flex-direction: column;
        align-items: stretch !important;
    }

        .app-nav-actions .btn {
            width: 100%;
        }

    .hero-actions .btn {
        min-width: 0;
    }
}

@media (max-width: 767.98px) {
    body.app-shell {
        font-size: 0.95rem;
    }

    .brand-badge {
        width: 32px;
        height: 32px;
        font-size: 0.88rem;
        border-radius: 10px;
    }

    .brand-text {
        font-size: 0.98rem;
    }

    .brand-subtext {
        font-size: 0.64rem;
    }

    .product-card-body,
    .summary-card,
    .app-card-body {
        padding: 1rem;
    }

    .privacy-page,
    .legal-page,
    .disc-page,
    .sd-page {
        padding: 1.25rem 0 2rem;
    }

    .app-footer-compact .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .hero-title {
        font-size: 1.9rem;
    }
}
