:root {
    --bg: #f6f8fa;
    --surface: #ffffff;
    --surface-muted: #f1f5f9;
    --border: #d8dee6;
    --text: #1f2937;
    --muted: #64748b;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #15803d;
    --danger: #b91c1c;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
}

a {
    color: inherit;
}

main {
    min-height: calc(100vh - 180px);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px clamp(18px, 4vw, 56px);
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    min-width: max-content;
}

.brand-logo {
    width: 42px;
    height: 42px;
}

.brand-text {
    font-size: 22px;
    font-weight: 750;
    letter-spacing: 0;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
}

.nav-link,
.nav-button {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 160ms ease, color 160ms ease;
}

.nav-link:hover,
.nav-button:hover,
.nav-link.active {
    background: var(--surface-muted);
    color: var(--text);
}

.nav-link-muted {
    border: 1px solid var(--border);
    color: var(--text);
}

.nav-dropdown {
    position: relative;
    display: inline-flex;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 40;
    display: none;
    width: 260px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    display: grid;
    gap: 2px;
}

.nav-dropdown-menu a {
    display: block;
    padding: 9px 10px;
    border-radius: 6px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.nav-dropdown-menu a:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.nav-user {
    color: var(--muted);
    font-size: 13px;
    padding: 0 6px;
}

.hero-section {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
    gap: clamp(28px, 5vw, 64px);
    align-items: center;
    padding: clamp(48px, 7vw, 96px) clamp(18px, 5vw, 72px) clamp(36px, 5vw, 72px);
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 760px;
    margin-bottom: 18px;
    font-size: clamp(40px, 6vw, 72px);
    line-height: 1.02;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 14px;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.12;
    letter-spacing: 0;
}

h3 {
    margin-bottom: 8px;
    font-size: 19px;
}

.hero-copy {
    max-width: 660px;
    color: var(--muted);
    font-size: 20px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 28px 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--surface-muted);
}

.btn-danger {
    color: #fff;
    background: #b91c1c;
    border-color: #991b1b;
}

.btn-danger:hover {
    color: #fff;
    background: #991b1b;
}

.trust-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    max-width: 660px;
    margin: 28px 0 0;
}

.trust-strip div {
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.trust-strip dt {
    font-weight: 800;
}

.trust-strip dd {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.product-preview {
    display: flex;
    flex-direction: column;
    overflow: visible;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.product-preview:hover {
    z-index: 10;
}

.product-preview figure,
.product-preview .image {
    margin: 0;
    overflow: visible;
}

.product-preview img {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    background: #f8fafc;
    border-radius: 8px;
    transform-origin: center center;
    transition: transform 180ms ease;
}

.product-preview:hover img {
    transform: scale(1.5);
}

.preview-titlebar {
    order: -1;
    display: none;
    align-items: center;
    gap: 7px;
    height: 42px;
    padding: 0 14px;
    background: #eef2f7;
    border-bottom: 1px solid var(--border);
}

.preview-titlebar span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd5e1;
}

.preview-titlebar strong {
    margin-left: 8px;
    font-size: 14px;
}

.preview-patient {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    font-weight: 650;
}

.status-dot {
    color: var(--success);
}

.preview-grid {
    display: grid;
    grid-template-columns: 170px 1fr;
    min-height: 360px;
}

.preview-tools {
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 16px;
    background: #f8fafc;
    border-right: 1px solid var(--border);
}

.preview-tools button {
    min-height: 38px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-weight: 650;
}

.preview-panel {
    padding: 22px;
}

.preview-panel p {
    color: var(--muted);
}

.preview-response {
    display: grid;
    gap: 10px;
    margin-top: 22px;
    padding: 18px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.preview-response span {
    padding: 9px 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: var(--muted);
}

.section {
    padding: clamp(42px, 6vw, 82px) clamp(18px, 5vw, 72px);
}

.section-heading {
    max-width: 760px;
    margin-bottom: 28px;
}

.workflow-section,
.media-section,
.cta-section {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.workflow-steps,
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.workflow-steps article,
.feature-grid article {
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.workflow-section .workflow-steps article {
    background: #f8fafc;
}

.step-number,
.line-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 16px;
    border: 1px solid #bfdbfe;
    border-radius: 50%;
    color: var(--primary);
    background: #eff6ff;
    font-weight: 800;
}

.line-icon {
    font-size: 22px;
}

.feature-grid p,
.workflow-steps p,
.media-copy p,
.privacy-list p,
.cta-section p {
    color: var(--muted);
}

.media-section {
    display: grid;
    grid-template-columns: minmax(0, 0.75fr) minmax(420px, 1.25fr);
    gap: 28px;
    align-items: center;
}

.video-frame {
    padding: 10px;
    background: #0f172a;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.video-frame video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #fff;
    border-radius: 4px;
}

.download-card img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 16px 0;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.privacy-section {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 30px;
}

.privacy-list {
    display: grid;
    gap: 12px;
}

.privacy-list p {
    margin: 0;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.cta-section {
    padding: 46px clamp(18px, 5vw, 72px);
    text-align: center;
}

.site-footer {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 20px;
    align-items: center;
    padding: 28px clamp(18px, 5vw, 72px);
    color: var(--muted);
    background: #0f172a;
}

.site-footer strong {
    color: #fff;
}

.site-footer p {
    margin: 4px 0 0;
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.site-footer a {
    color: #dbeafe;
    text-decoration: none;
}

.site-footer small {
    color: #cbd5e1;
}

.download-section,
.documentation-section,
.forum-section,
.content,
form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.download-section,
.documentation-section,
.forum-section,
.content {
    width: min(1040px, calc(100% - 36px));
    margin: 36px auto;
    padding: 30px;
}

.forum-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.forum-heading-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.forum-category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 22px;
}

.forum-category-nav a,
.forum-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.forum-category-nav a {
    padding: 8px 12px;
}

.forum-category-nav a.active,
.forum-category-nav a:hover {
    border-color: var(--primary);
    background: #eff6ff;
    color: var(--primary);
}

.forum-category-nav span {
    min-width: 22px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #e2e8f0;
    color: var(--text);
    text-align: center;
}

.forum-category-badge {
    margin-bottom: 10px;
    padding: 5px 10px;
    background: #eef2f7;
}

.forum-topic-list {
    display: grid;
    gap: 12px;
}

.forum-topic-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
}

.forum-topic-card h2 {
    margin-bottom: 8px;
    font-size: 22px;
}

.forum-topic-card h2 a {
    color: var(--text);
    text-decoration: none;
}

.forum-topic-card h2 a:hover {
    color: var(--primary);
}

.forum-topic-card p {
    color: var(--muted);
}

.forum-topic-card small,
.forum-post-meta {
    color: var(--muted);
    font-size: 13px;
}

.forum-topic-meta {
    display: grid;
    place-items: center;
    align-content: center;
    border-left: 1px solid var(--border);
    color: var(--muted);
}

.forum-topic-meta strong {
    color: var(--text);
    font-size: 24px;
}

.forum-form {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.forum-form textarea {
    min-height: 180px;
    resize: vertical;
}

.forum-post {
    margin: 14px 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
}

.forum-post-topic {
    background: #fff;
}

.forum-post-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.forum-post-body {
    line-height: 1.65;
}

.forum-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.forum-category-admin-list {
    display: grid;
    gap: 12px;
    margin-top: 24px;
}

.forum-category-admin-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
}

.forum-category-admin-card h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.forum-category-admin-card p {
    margin: 0 0 8px;
    color: var(--muted);
}

.inline-delete-form {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.documentation-image {
    margin: 0 0 24px;
}

.documentation-image img {
    display: block;
    width: 100%;
    max-width: 920px;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.documentation-section img {
    max-width: 100%;
    height: auto;
}

.download-button,
button,
input[type="submit"] {
    border-radius: 6px;
}

code {
    background: #eef2f7;
    border-radius: 4px;
    padding: 2px 5px;
}

.info-box {
    border-left: 4px solid var(--primary);
    background: #eff6ff;
}

.warning-box {
    border-left: 4px solid var(--danger);
    background: #fef2f2;
}

@media (max-width: 980px) {
    .hero-section,
    .media-section,
    .privacy-section {
        grid-template-columns: 1fr;
    }

    .product-preview {
        max-width: 760px;
    }

    .workflow-steps,
    .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .site-footer {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .site-header {
        position: static;
        align-items: flex-start;
        flex-direction: column;
    }

    .site-nav {
        justify-content: flex-start;
    }

    .forum-heading,
    .forum-topic-card {
        grid-template-columns: 1fr;
    }

    .forum-heading {
        flex-direction: column;
    }

    .forum-topic-meta {
        justify-items: flex-start;
        border-left: 0;
        border-top: 1px solid var(--border);
        padding-top: 12px;
    }

    .nav-dropdown {
        display: flex;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .nav-dropdown-menu {
        position: static;
        display: grid;
        width: 100%;
        box-shadow: none;
        border-radius: 6px;
    }

    .trust-strip,
    .workflow-steps,
    .feature-grid,
    .preview-grid {
        grid-template-columns: 1fr;
    }

    .preview-tools {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    h1 {
        font-size: 38px;
    }
}

/* Auth pages */
.auth-shell,
.register-section {
    width: min(560px, calc(100% - 36px));
    margin: clamp(34px, 7vw, 72px) auto;
    padding: clamp(24px, 4vw, 34px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.register-section h2 {
    margin-bottom: 10px;
    font-size: 30px;
    line-height: 1.15;
}

.register-section > p {
    color: var(--muted);
}

.register-form {
    display: grid;
    gap: 12px;
    margin-top: 22px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.register-form label {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.register-form input {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
}

.register-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
    outline: none;
}

.register-form input:disabled {
    color: var(--muted);
    background: #f1f5f9;
}

.copy-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 8px;
    align-items: stretch;
}

.register-form .copy-button {
    width: 44px;
    min-height: 42px;
    margin: 0;
    padding: 0;
    color: var(--primary);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.register-form .copy-button:hover,
.register-form .copy-button.copied {
    color: #fff;
    background: var(--primary);
}

.copy-button svg {
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.register-form button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-top: 8px;
    padding: 11px 18px;
    color: #fff;
    background: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 6px;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}

.register-form button:hover {
    background: var(--primary-dark);
}

.message-info,
.message-error {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 6px;
    font-weight: 650;
}

.message-info {
    color: #166534;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
}

.message-error {
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.register-section a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.register-section a:hover {
    text-decoration: underline;
}

@media (max-width: 520px) {
    .register-section {
        width: min(100% - 24px, 560px);
        padding: 22px 18px;
    }
}

/* CKEditor 5 editor page */
.editor-section {
    width: min(1120px, calc(100% - 36px));
    margin: 36px auto;
    padding: clamp(24px, 4vw, 34px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.compact-heading h1 {
    font-size: clamp(30px, 4vw, 44px);
}

.editor-form {
    display: grid;
    gap: 12px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.editor-form label {
    font-weight: 750;
}

.editor-page-select {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin: 0 0 22px;
    padding: 14px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: none;
}

.editor-page-select label {
    font-weight: 750;
}

.editor-page-select select {
    min-height: 40px;
    min-width: min(280px, 100%);
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
}

.editor-updated {
    color: var(--muted);
    font-size: 14px;
}

.editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.editor-actions .btn {
    font: inherit;
}

.editor-note {
    margin: 4px 0 0;
    color: var(--muted);
}

.ck-editor__editable_inline {
    min-height: 420px;
}

