:root {
    --bg-page: #FFFFFF;
    --midas-blue: #3A5AFE;
    --midas-blue-rgb: 58, 90, 254;
    --header-bg: #3A5AFE;
    --header-fg: #FFFFFF;
    --header-line: rgba(255, 255, 255, 0.35);
    --bg-white: #FFFFFF;
    --text-primary: #1C1C1E;
    --text-secondary: #8E8E93;
    --border-color: #E5E5EA;
}

* { box-sizing: border-box; }

body.cms-page {
    margin: 0;
    padding: 12px 20px;
    display: flex;
    justify-content: center;
    background: var(--bg-page);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    height: auto !important;
    min-height: 100dvh;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

body.cms-page .app-container {
    width: 100%;
    max-width: 1400px;
    height: auto !important;
    max-height: none !important;
    min-height: calc(100dvh - 24px);
    overflow: visible !important;
    display: flex;
    flex-direction: column;
    border: var(--app-frame-border-width, 1px) solid var(--app-frame-border-color, #E8E8ED);
    border-radius: 20px;
    background-color: #FFFFFF;
}

/* Header / footer — layout.css */

.app-body.page-body {
    overflow: visible !important;
    flex: 1 0 auto;
    min-height: 0;
    padding: 32px 24px;
    background: #FFFFFF;
}

.page-card {
    max-width: 991px;
    width: 100%;
    margin: 0 auto;
    padding: 36px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .03);
}

.page-card h1 {
    margin: 0 0 24px;
    font-size: 30px;
    color: var(--text-primary);
}

.page-content {
    color: #3A3A3C;
    font-size: 16px;
    line-height: 1.75;
}

.page-content p { margin: 0 0 18px; }

.page-meta {
    margin: -12px 0 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

body.cms-page .app-footer {
    margin-top: auto;
}

@media (max-width: 991px) {
    body.cms-page {
        padding: 0;
        display: block;
        justify-content: initial;
    }

    body.cms-page .app-container {
        width: 100%;
        max-width: 100% !important;
        min-height: 100dvh;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        border: none;
    }

    .page-card {
        padding: 20px 16px;
        border-radius: 0;
        box-shadow: none;
        max-width: 100%;
    }

    .page-card h1 { font-size: 24px; }

    .app-body.page-body {
        padding: 8px 12px 12px;
        border-radius: 0;
    }
}

@media (max-width: 575px) {
    .page-card h1 { font-size: 22px; }
    .page-content { font-size: 15px; }
}
