:root {
    --bp-primary: #0a4d8c;
    --bp-primary-dark: #083d6f;
    --bp-accent: #1a7fd4;
    --bp-surface: #f4f7fb;
    --bp-border: #d8e2ef;
}

html {
    height: 100%;
}

html,
body {
    min-height: 100%;
}

body.app-body {
    background: var(--bp-surface);
    color: #1f2937;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.app-navbar.navbar {
    background: linear-gradient(135deg, var(--bp-primary) 0%, var(--bp-primary-dark) 100%) !important;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.app-navbar .navbar-brand {
    font-weight: 700;
    letter-spacing: 0.01em;
}

.app-navbar .app-navbar-logo {
    width: 38px;
    height: 38px;
    object-fit: cover;
    object-position: center;
    border-radius: 4px;
    display: block;
    flex-shrink: 0;
}

.app-navbar .nav-link {
    font-weight: 500;
    padding: 0.45rem 0.85rem !important;
    border-radius: 0.375rem;
    margin: 0 0.1rem;
    transition: background-color 0.15s ease;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus {
    background: rgba(255, 255, 255, 0.12);
}

.app-navbar .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.app-main {
    flex: 1 0 auto;
    padding: 1.5rem 0 2.5rem;
}

.app-page-header {
    margin-bottom: 1.5rem;
}

.app-page-header h1 {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.app-page-header p {
    color: #5b6b7c;
    margin-bottom: 0;
}

.app-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.app-action-card {
    background: #fff;
    border: 1px solid var(--bp-border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    height: 100%;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.app-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(10, 77, 140, 0.12);
    border-color: #b9cfe6;
    color: inherit;
}

.app-action-card .icon-wrap {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 77, 140, 0.1);
    color: var(--bp-primary);
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.app-action-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
}

.app-action-card p {
    font-size: 0.9rem;
    color: #5b6b7c;
    margin-bottom: 0;
}

.app-hero {
    background: #fff;
    border: 1px solid var(--bp-border);
    border-radius: 1rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    margin-bottom: 1.5rem;
}

.app-values {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.app-value-item {
    background: #fff;
    border: 1px solid var(--bp-border);
    border-radius: 0.75rem;
    padding: 1rem;
}

.app-value-item h3 {
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.app-value-item p {
    font-size: 0.9rem;
    color: #5b6b7c;
    margin-bottom: 0;
}

/* Chat page with optional top navigation */
body.chat-page-body.chat-with-nav {
    overflow: hidden;
    height: 100dvh;
}

.chat-shell-with-nav {
    min-height: 0;
    height: 100%;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-shell-with-nav .chat-page-layout {
    flex: 1 1 auto;
    min-height: 0;
}

.comments-page-shell {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

.comments-page-shell .comments-page-header {
    margin-bottom: 1rem;
}

/* Terms and conditions modal */
body.terms-gate-active {
    overflow: hidden;
}

.terms-modal-content {
    border-radius: 0.75rem;
    max-height: calc(100vh - 2rem);
}

.terms-modal-header {
    padding: 1.25rem 1.5rem 0;
}

.terms-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.75rem 1.5rem 1.25rem;
}

.terms-scroll-area {
    max-height: min(55vh, 32rem);
    overflow-y: auto;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border: 1px solid var(--bp-border);
    border-radius: 0.5rem;
}

.terms-choice-group {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.terms-choice-option {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.35rem 0;
}

.terms-choice-option .form-check-input {
    float: none;
    margin: 0.2rem 0 0;
    flex-shrink: 0;
    cursor: pointer;
}

.terms-choice-option .form-check-label {
    font-size: 0.9rem;
    line-height: 1.45;
    cursor: pointer;
}

.terms-modal-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.25rem;
}

.terms-document h2 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--bp-primary-dark);
}

.terms-document h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 0.75rem;
    margin-bottom: 0.35rem;
}

.terms-document p,
.terms-document li {
    font-size: 0.9rem;
    line-height: 1.55;
    color: #374151;
}

.terms-document ul {
    padding-left: 1.25rem;
}

.terms-document .terms-meta {
    font-size: 0.875rem;
    color: #4b5563;
}

.legal-terms-body .terms-document {
    padding: 0.25rem 0.5rem;
}

.app-footer {
    flex-shrink: 0;
    background: #fff;
    margin-top: auto;
}

/* Subscription / pricing tiers */
.pricing-hero {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 2rem;
}

.pricing-hero h1 {
    font-weight: 800;
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    color: var(--bp-primary-dark);
    margin-bottom: 0.75rem;
}

.pricing-hero p {
    color: #5b6b7c;
    font-size: 1.05rem;
    margin-bottom: 0;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    align-items: stretch;
}

.pricing-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--bp-border);
    border-radius: 1rem;
    padding: 1.75rem 1.5rem;
    height: 100%;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.pricing-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(10, 77, 140, 0.14);
    border-color: #b9cfe6;
}

.pricing-card.featured {
    border-color: var(--bp-primary);
    border-width: 2px;
    box-shadow: 0 12px 32px rgba(10, 77, 140, 0.16);
}

.pricing-badge {
    position: absolute;
    top: -0.85rem;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--bp-primary) 0%, var(--bp-accent) 100%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    white-space: nowrap;
}

.pricing-card .pricing-tier {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--bp-primary-dark);
    margin-bottom: 0.15rem;
}

.pricing-card .pricing-tagline {
    color: #6b7a8c;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.pricing-card .pricing-price {
    font-size: 2.25rem;
    font-weight: 800;
    color: #1f2937;
    line-height: 1.1;
}

.pricing-card .pricing-period {
    color: #6b7a8c;
    font-size: 0.95rem;
    font-weight: 500;
}

.pricing-card .pricing-subtext {
    color: #8a97a6;
    font-size: 0.82rem;
    margin-top: 0.15rem;
    min-height: 1.1rem;
}

.pricing-card hr {
    border-color: var(--bp-border);
    opacity: 1;
    margin: 1.25rem 0;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    flex: 1 1 auto;
}

.pricing-features li {
    position: relative;
    padding-left: 1.6rem;
    margin-bottom: 0.6rem;
    font-size: 0.92rem;
    color: #374151;
}

.pricing-features li::before {
    content: "\F26E";
    font-family: "bootstrap-icons";
    position: absolute;
    left: 0;
    top: 0.05rem;
    color: var(--bp-accent);
    font-size: 0.95rem;
}

.pricing-card .btn {
    margin-top: auto;
    width: 100%;
    font-weight: 600;
}

.pricing-partner {
    background: linear-gradient(135deg, var(--bp-primary) 0%, var(--bp-primary-dark) 100%);
    color: #fff;
    border-radius: 1rem;
    padding: clamp(1.5rem, 3vw, 2.25rem);
    margin-top: 1.75rem;
    text-align: center;
}

.pricing-partner h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.pricing-partner p {
    color: rgba(255, 255, 255, 0.85);
    max-width: 620px;
    margin: 0 auto 1.25rem;
}
