/* Base Styles */

:root {
    --navbar-height: 72px; /* adjust if navbar height changes */
}

/* Ensure page content starts below navbar */
.pt-navbar {
    padding-top: var(--navbar-height);
}

/* Make sure min-h-screen fills full height */
.min-h-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Keep navbar fixed */
.navbar.fixed-top {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

body {
    font-family: 'Nunito', sans-serif !important;
    background-color: var(--c-bg);
    color: var(--c-text);
    overflow-x: hidden;
}

/* Navbar styles */
.navbar {
    background: linear-gradient(90deg, var(--c-surface-inverse) 0%, var(--c-surface-inverse) 100%);
    box-shadow: 0 4px 12px rgb(var(--c-shadow-rgb) / 0.1);
    padding: 0.75rem 0;
    transition: all 0.3s ease;
}

.navbar-scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 5px 15px rgb(var(--c-shadow-rgb) / 0.1);
}

.navbar .nav-link {
    color: rgb(var(--c-text-inverse-rgb) / 0.8) !important;
    padding: 0.5rem 1rem;
    transition: all 0.3s;
    position: relative;
}

.navbar .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--c-accent);
    transition: all 0.3s;
    transform: translateX(-50%);
    opacity: 0;
}

.navbar .nav-link:hover::after,
.navbar .nav-link.active::after {
    width: 80%;
    opacity: 1;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--c-text-inverse) !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--c-surface-inverse-raised) 0%, var(--c-surface-inverse) 100%);
    padding: 6rem 0 5rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-size: 100% 100px;
    background-position: bottom;
    background-repeat: no-repeat;
    opacity: 0.6;
    z-index: 1;
}

.hero-logo {
    filter: drop-shadow(0 10px 20px rgb(var(--c-shadow-rgb) / 0.15));
    transition: all 0.5s cubic-bezier(.25, .8, .25, 1);
    max-height: 200px;
    animation: floating 4s ease-in-out infinite;
}

@keyframes floating {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

.hero-text h1 {
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Features Section */
.features-section {
    padding: 5rem 0;
    background-color: var(--c-surface);
    position: relative;
    z-index: 2;
}

.feature-card {
    transition: all 0.3s cubic-bezier(.25, .8, .25, 1);
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgb(var(--c-shadow-rgb) / 0.1), 0 5px 15px rgb(var(--c-shadow-rgb) / 0.07);
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: rotateY(180deg);
}

/* Form section */
.form-section {
    padding: 5rem 0;
    background-color: var(--c-bg);
    position: relative;
    margin-top: 0.4rem; /* ✅ add this for space below navbar */
}

.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;

}

.form-card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgb(var(--c-shadow-rgb) / 0.05), 0 5px 15px rgb(var(--c-shadow-rgb) / 0.05);
}

.form-card .card-body {
    padding: 0;
}

.form-sidebar {
    background: linear-gradient(135deg, var(--c-surface-inverse-raised) 0%, var(--c-surface-inverse) 100%);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.form-sidebar img {
    max-width: 80%;
    margin-bottom: 2rem;
    filter: drop-shadow(0 5px 15px rgb(var(--c-shadow-rgb) / 0.1));
    transition: all 0.3s ease;
}

.form-sidebar:hover img {
    transform: scale(1.05);
}

.form-sidebar h3 {
    color: var(--c-text-muted) !important;
}

.input-group-text {
    background-color: var(--c-bg);
    color: var(--c-accent);
}

.form-control:focus,
.form-select:focus {
    box-shadow: none;
    border-color: var(--c-border-strong);
}

/* Accordion FAQ section */
.faq-section {
    padding: 5rem 0;
    background-color: var(--c-surface);
}

.accordion-item {
    border: none;
    margin-bottom: 1rem;
    border-radius: 8px !important;
    overflow: hidden;
    box-shadow: 0 2px 10px rgb(var(--c-shadow-rgb) / 0.05);
    transition: all 0.3s ease;
}

.accordion-item:hover {
    box-shadow: 0 5px 15px rgb(var(--c-shadow-rgb) / 0.1);
}

.accordion-button {
    font-weight: 600;
    padding: 1.25rem;
}

.accordion-button:not(.collapsed) {
    background-color: rgb(var(--c-accent-rgb) / 0.1);
    color: var(--c-accent);
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: rgb(var(--c-accent-rgb) / 0.2);
}

/* Footer section */
.footer {
    background: linear-gradient(90deg, var(--c-surface-inverse) 0%, var(--c-surface-inverse) 100%);
    padding: 3rem 0;
}

.footer a {
    color: rgb(var(--c-text-inverse-rgb) / 0.7);
    transition: all 0.2s;
    text-decoration: none;
}

.footer a:hover {
    color: var(--c-text-inverse);
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgb(var(--c-text-inverse-rgb) / 0.1);
    margin-right: 0.5rem;
    transition: all 0.3s;
}

.social-icons a:hover {
    background-color: var(--c-accent);
    transform: translateY(-3px);
}

/* Button styles */
.btn-primary {
    background-color: var(--c-accent);
    border-color: var(--c-accent);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--c-surface-inverse-raised);
    border-color: var(--c-text-muted);
    box-shadow: 0 4px 15px rgb(var(--c-accent-rgb) / 0.4);
    transform: translateY(-2px);
}

.btn-outline-light:hover {
    box-shadow: 0 4px 15px rgb(var(--c-text-inverse-rgb) / 0.2);
    transform: translateY(-2px);
}

/* Form validation styles */
.is-invalid {
    border-color: var(--c-danger);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.is-valid {
    border-color: var(--c-success);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
    color: var(--c-danger);
    font-size: 0.875em;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--c-accent);
    color: var(--c-text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    box-shadow: 0 2px 10px rgb(var(--c-shadow-rgb) / 0.2);
    z-index: 99;
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
    cursor: pointer;
}

.back-to-top:hover {
    background-color: var(--c-surface-inverse-raised);
    transform: translateY(-3px);
}

/* Responsive styles */
@media (max-width: 991px) {
    .hero-text {
        text-align: center;
        margin-bottom: 3rem;
    }

    .navbar .navbar-nav {
        margin-top: 1rem;
    }

    .navbar .nav-link::after {
        bottom: 0;
        left: 0;
        transform: none;
    }

    .navbar .nav-link:hover::after,
    .navbar .nav-link.active::after {
        width: 30px;
    }

    .form-sidebar {
        border-radius: 16px 16px 0 0;
        padding: 2rem 1rem;
    }
}

/* Password strength meter */
.password-strength-meter {
    margin-top: 8px;
}

.strength-bar {
    height: 6px;
    width: 100%;
    background: var(--c-surface-subtle);
    border-radius: 4px;
    margin-bottom: 4px;
    overflow: hidden;
    position: relative;
}

.strength-bar::after {
    content: "";
    display: block;
    height: 100%;
    width: 0;
    background-color: red;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-text {
    font-size: 0.9em;
    font-weight: 500;
}

.strength-0 .strength-bar::after { width: 20%; background-color: var(--c-danger); }
.strength-1 .strength-bar::after { width: 40%; background-color: var(--c-warning); }
.strength-2 .strength-bar::after { width: 60%; background-color: var(--c-warning); }
.strength-3 .strength-bar::after { width: 80%; background-color: var(--c-accent); }
.strength-4 .strength-bar::after { width: 100%; background-color: var(--c-success); }

/* ==========================================================
   Create ticket + login pages (hp-*)
   ========================================================== */
/* Tokens also cover the thank-you page and the "create a new ticket" modal, which sit outside .hp-page */
.hp-page,
.hp-plain,

.hp-page {
    flex: 1;
    background: var(--c-bg);
    color: var(--c-text);
    padding: clamp(1.5rem, 4vw, 3rem) 1rem clamp(2rem, 5vw, 4rem);
}

/* Card */
.hp-card {
    width: 100%;
    margin: 0 auto;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 1rem;
    box-shadow: 0 1px 2px rgb(var(--c-text-rgb) / 0.05), 0 16px 40px -24px rgb(var(--c-text-rgb) / 0.35);
}

.hp-card--narrow {
    max-width: 27rem;
}

.hp-card-head {
    padding: 1.5rem clamp(1.25rem, 4vw, 2rem) 0;
}

.hp-card-head h1,
.hp-login-head h1 {
    font-size: 1.625rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--c-text);
    margin: 0;
}

.hp-card-head p {
    max-width: 60ch;
    margin: 0.375rem 0 0;
    color: var(--c-text-muted);
    line-height: 1.5;
}

.hp-card-body {
    padding: clamp(1.25rem, 4vw, 2rem);
}

/* Form sections */
.hp-row {
    display: grid;
    gap: 0 1rem;
}

@media (min-width: 576px) {
    .hp-row {
        grid-template-columns: 1fr 1fr;
    }
}

.hp-field {
    margin-bottom: 1.125rem;
}

.hp-label {
    display: block;
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--c-text);
    margin-bottom: 0.375rem;
}

/* Inputs with a leading icon */
.hp-input {
    position: relative;
}

.hp-input > .bi {
    position: absolute;
    left: 0.875rem;
    top: 1.4375rem;
    transform: translateY(-50%);
    color: var(--c-text-muted);
    pointer-events: none;
}

.hp-page .hp-input > .form-control,
.hp-page .hp-input > .form-select {
    padding-left: 2.5rem;
}

.hp-page .form-control,
.hp-page .form-select {
    min-height: 2.875rem;
    font-size: 1rem;
    border-radius: 0.625rem;
    border-color: var(--c-border);
    background-color: var(--c-surface);
    color: var(--c-text);
    /* Keep fields that validation jumps to clear of the fixed navbar */
    scroll-margin-top: calc(var(--navbar-height) + 2.5rem);
}

.hp-page .form-control::placeholder {
    color: var(--c-text-muted);
}

.hp-page .form-control:focus,
.hp-page .form-select:focus {
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px rgb(var(--c-accent-rgb) / 0.22);
}

.hp-page .form-control.is-invalid,
.hp-page .form-select.is-invalid {
    border-color: var(--c-danger);
}

.hp-page .invalid-feedback {
    color: var(--c-danger);
    font-size: 0.875rem;
}

/* jQuery Validate errors (id ends in -error) and the password field's wrapped input */
.hp-page .invalid-feedback[id$="-error"],
.was-validated .hp-input:has(:invalid) ~ .invalid-feedback {
    display: block;
}

.hp-page .hp-desc-input {
    min-height: 9rem;
    max-height: 24rem;
    resize: vertical;
    line-height: 1.55;
}

/* Description boxes are rich text editors (assets/js/rich-editor.js), so they act like a field but are divs */
.hp-rich {
    display: flex;
    flex-direction: column;
    min-height: 9rem;
    max-height: 24rem;
    overflow-y: auto;
    cursor: text;
}

.hp-rich .re-content { flex: 1; }
.hp-rich:focus-within { border-color: var(--c-border-strong); }

.hp-page .hp-rich:focus-within {
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px rgb(var(--c-accent-rgb) / 0.22);
}

.hp-hint {
    margin: 0.375rem 0 0;
    font-size: 0.875rem;
    color: var(--c-text-muted);
}

/* Attachments drop zone */
.hp-drop {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem;
    border: 1.5px dashed var(--c-border);
    border-radius: 0.75rem;
    background: var(--c-surface-subtle);
    color: var(--c-text-muted);
    transition: border-color 0.15s, background-color 0.15s;
}

.hp-drop.is-dropping {
    border-color: var(--c-accent);
    background: var(--c-accent-soft);
}

.hp-drop > .bi {
    font-size: 1.75rem;
    color: var(--c-accent-hover);
}

.hp-drop-text {
    flex: 1 1 12rem;
    min-width: 0;
    font-size: 0.9375rem;
}

.hp-drop-text strong {
    display: block;
    color: var(--c-text);
}

@media (max-width: 575.98px) {
    .hp-drop .hp-btn {
        width: 100%;
    }
}

.hp-file:focus-visible + .hp-btn {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
}

.hp-tray {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.hp-tray[hidden] {
    display: none;
}

.hp-chip {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 14rem;
    padding: 0.375rem 2rem 0.375rem 0.375rem;
    border: 1px solid var(--c-border);
    border-radius: 0.5rem;
    background: var(--c-surface);
    font-size: 0.8125rem;
}

.hp-chip img,
.hp-chip .hp-chip-icon {
    flex: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.375rem;
    object-fit: cover;
}

.hp-chip .hp-chip-icon {
    display: grid;
    place-items: center;
    background: var(--c-surface-subtle);
    font-size: 1.25rem;
    color: var(--c-text-muted);
}

.hp-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hp-chip-remove {
    position: absolute;
    top: 50%;
    right: 0.25rem;
    transform: translateY(-50%);
    width: 1.75rem;
    height: 1.75rem;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--c-text-muted);
}

.hp-chip-remove:hover {
    background: var(--c-surface-subtle);
    color: var(--c-danger);
}

/* Buttons and links */
.hp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 3rem;
    padding: 0 1.5rem;
    border-radius: 0.625rem;
    border: 1px solid var(--c-accent-hover);
    background: var(--c-accent-hover);
    color: var(--c-text-inverse);
    font-weight: 700;
    font-size: 1.0625rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.hp-btn:hover {
    background: var(--c-accent-strong);
    border-color: var(--c-accent-strong);
    color: var(--c-text-inverse);
}

.hp-btn:disabled {
    opacity: 0.6;
    cursor: progress;
}

/* Navy from the navbar, for the main button on the create ticket and login pages */
.hp-btn-navy {
    background: var(--c-surface-inverse);
    border-color: var(--c-text-muted);
}

.hp-btn-navy:hover {
    background: var(--c-surface-inverse);
    border-color: var(--c-text-muted);
}

.hp-btn-ghost {
    background: var(--c-surface);
    color: var(--c-text);
    border-color: var(--c-border);
}

.hp-btn-ghost:hover {
    background: var(--c-accent-soft);
    border-color: var(--c-border);
    color: var(--c-text);
}

.hp-btn-sm {
    min-height: 2.5rem;
    padding: 0 1rem;
    font-size: 0.9375rem;
    margin: 0;
}

.hp-btn-block {
    width: 100%;
}

.hp-link {
    color: var(--c-accent-hover);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.2em;
    text-decoration-thickness: 1px;
}

.hp-link:hover {
    color: var(--c-accent-strong);
}

.hp-link-quiet {
    font-weight: 600;
}

:is(.hp-page, .hp-plain, .ai-modal) :is(.hp-btn, .hp-link, .hp-chip-remove, .hp-reveal, .hp-plain-copy):focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
}

/* AI answer and existing tickets */
.hp-answer {
    border-left: 4px solid var(--c-accent);
    background: var(--c-accent-soft);
    border-radius: 0 0.75rem 0.75rem 0;
    padding: 1rem 1.25rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    overflow-wrap: anywhere;
}

.hp-answer > :last-child {
    margin-bottom: 0;
}

.hp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hp-actions > form {
    flex: 1 1 12rem;
    display: flex;
}

.hp-actions .hp-btn {
    flex: 1;
}

.hp-tickets {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    border: 1px solid var(--c-border);
    border-radius: 0.75rem;
}

.hp-tickets li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
}

.hp-tickets li + li {
    border-top: 1px solid var(--c-border);
}

.hp-tickets-text {
    flex: 1;
    min-width: 0;
}

.hp-tickets-code {
    display: block;
    font-size: 0.8125rem;
    color: var(--c-text-muted);
}

.hp-tickets-subject {
    font-weight: 700;
    overflow-wrap: anywhere;
}

/* Login */
.hp-page .hp-password .form-control {
    padding-right: 3rem;
}

.hp-reveal {
    position: absolute;
    top: 0.3125rem;
    right: 0.3125rem;
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    font-size: 1.125rem;
    color: var(--c-text-muted);
}

.hp-reveal:hover {
    background: var(--c-accent-soft);
    color: var(--c-text);
}

.hp-auth-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-bottom: 1.5rem;
}

.hp-auth-row .form-check-label {
    color: var(--c-text);
}

.hp-page .form-check-input:checked {
    background-color: var(--c-accent-hover);
    border-color: var(--c-accent-hover);
}

/* Slim footer for public pages */
.footer.footer-slim {
    padding: 1.25rem 0;
    font-size: 0.875rem;
}

.footer-slim .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
}

.footer-slim .footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgb(var(--c-text-inverse-rgb) / 0.85);
    font-weight: 700;
}

.footer-slim .footer-brand img {
    width: 1.5rem;
    height: 1.5rem;
    object-fit: contain;
}

.footer-slim nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

/* Keep the footer at the bottom on short pages */
body:has(.hp-page) {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

body:has(.hp-page) .min-h-screen {
    flex: 1;
}

/* Log in as support: set apart from the customer links in the top nav */
.navbar .nav-agent {
    display: inline-flex;
    align-items: center;
    margin: 0.25rem 0 0.25rem 0.75rem;
    padding: 0.375rem 1rem;
    border: 1px solid rgb(var(--c-text-inverse-rgb) / 0.45);
    border-radius: 999px;
    color: var(--c-text-inverse);
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s;
}

.navbar .nav-agent:hover,
.navbar .nav-agent.active {
    background: rgb(var(--c-text-inverse-rgb) / 0.12);
    border-color: var(--c-border);
    color: var(--c-text-inverse);
}

.navbar .nav-agent:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
}

@media (min-width: 992px) {
    .navbar-nav:has(.nav-agent) {
        align-items: center;
    }
}

@media (max-width: 991.98px) {
    .navbar .nav-agent {
        margin: 0.5rem 0 0.75rem;
    }
}

/* Create ticket: stacked cards on narrow screens */
.hp-split {
    display: grid;
    gap: 1.5rem;
    max-width: 68rem;
    margin: 0 auto;
}

/* Wide screens: one-screen split, brand panel full height on the left and the
   form on the right. Only the form side scrolls, and only if the window is short. */
@media (min-width: 992px) {
    /* Panels run up behind the fixed navbar, so no strip shows if its height differs from --navbar-height */
    .hp-page--split {
        flex: none;
        height: 100dvh;
        margin-top: calc(-1 * var(--navbar-height));
        padding: 0;
        background: var(--c-surface);
    }

    body:has(.hp-page--split) .footer-slim {
        display: none;
    }

    /* Navbar becomes part of the split: transparent, brand in white over the panel,
       links in dark text over the white form side */
    body:has(.hp-page--split) .navbar {
        background: transparent;
        box-shadow: none;
    }

    body:has(.hp-page--split) .navbar > .container {
        max-width: none;
        padding-inline: clamp(1.25rem, 3vw, 2.5rem);
    }

    body:has(.hp-page--split) .navbar .nav-link {
        color: var(--c-text-body) !important;
    }

    body:has(.hp-page--split) .navbar .nav-link:hover,
    body:has(.hp-page--split) .navbar .nav-link.active {
        color: var(--c-text) !important;
    }

    body:has(.hp-page--split) .navbar .nav-agent {
        border-color: var(--c-text-muted);
        color: var(--c-text);
    }

    body:has(.hp-page--split) .navbar .nav-agent:hover,
    body:has(.hp-page--split) .navbar .nav-agent.active {
        background: var(--c-surface-inverse);
        border-color: var(--c-text-muted);
        color: var(--c-text-inverse);
    }

    .hp-split {
        grid-template-columns: 5fr 7fr;
        gap: 0;
        max-width: none;
        height: 100%;
    }

    .hp-split > .hp-brand-panel {
        padding-top: calc(var(--navbar-height) + 2rem);
        border-radius: 0;
        box-shadow: none;
    }

    /* The form side starts below the navbar so scrolled content never runs under the links */
    .hp-split > .hp-card {
        display: flex;
        flex-direction: column;
        align-self: end;
        height: calc(100% - var(--navbar-height));
        max-width: none;
        margin: 0;
        overflow-y: auto;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    /* Auto margins centre the form vertically and pin the footer to the bottom,
       but still let the column scroll from the top */
    .hp-split > .hp-card > * {
        width: 100%;
        max-width: 44rem;
        margin-inline: auto;
    }

    .hp-split > .hp-card > :first-child,
    .hp-form-foot {
        margin-top: auto;
    }

    .hp-split .hp-field {
        margin-bottom: 1rem;
    }

    .hp-split .hp-desc-input {
        min-height: 6.5rem;
    }

    .hp-split .hp-drop {
        padding: 0.75rem 1rem;
    }

    /* Login: narrower column, left-aligned like the ticket form; the navbar already shows the logo */
    .hp-split > .hp-card--narrow > * {
        max-width: 28rem;
    }

    .hp-split .hp-login-head {
        text-align: left;
    }

    .hp-split .hp-login-head img {
        display: none;
    }
}

.hp-brand-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: clamp(1.75rem, 4vw, 3rem) clamp(1.25rem, 3vw, 2.5rem);
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--c-surface-inverse-raised) 0%, var(--c-surface-inverse) 100%);
    box-shadow: 0 1px 2px rgb(var(--c-text-rgb) / 0.05), 0 16px 40px -24px rgb(var(--c-text-rgb) / 0.35);
    color: var(--c-text-muted);
    text-align: center;
}

.hp-brand-panel .hp-brand-title {
    font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem);
    font-weight: 800;
    line-height: 1.1;
    color: var(--c-text-inverse);
    margin: 0;
}

.hp-brand-panel > p {
    max-width: 26ch;
    text-wrap: balance;
    font-size: 1.0625rem;
    line-height: 1.55;
    margin: 0;
}

/* Sample conversation: a customer message, then support replying */
.hp-chat {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: min(100%, 22rem);
    margin-bottom: 2.25rem;
    text-align: left;
}

.hp-bubble {
    max-width: 85%;
    margin: 0;
    padding: 0.875rem 1.125rem;
    border-radius: 1.125rem;
    font-size: 1rem;
    line-height: 1.4;
    box-shadow: 0 8px 18px -10px rgb(var(--c-shadow-rgb) / 0.45);
}

.hp-bubble--customer {
    align-self: flex-end;
    border-bottom-right-radius: 0.25rem;
    background: var(--c-surface);
    color: var(--c-text);
}

.hp-chat-agent {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.hp-chat-avatar {
    flex: none;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0.3rem;
    border-radius: 50%;
    background: var(--c-surface);
    object-fit: contain;
}

.hp-chat-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
    min-width: 0;
}

.hp-chat-stack .hp-bubble {
    max-width: 100%;
}

.hp-bubble--agent {
    border-bottom-left-radius: 0.25rem;
    background: var(--c-surface-inverse);
    color: var(--c-text-inverse);
}

.hp-typing {
    display: flex;
    gap: 0.25rem;
    padding: 0.875rem 1rem;
}

.hp-typing span {
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 50%;
    background: var(--c-surface);
    opacity: 0.5;
    animation: hp-typing 1.2s ease-in-out infinite;
}

.hp-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.hp-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes hp-typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    30% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hp-typing span {
        animation: none;
        opacity: 0.85;
    }
}

/* Small footer under the form; replaces the page footer on wide screens */
.hp-form-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 1.25rem;
    padding: 1rem clamp(1.25rem, 4vw, 2rem) 1.25rem;
    font-size: 0.875rem;
    color: var(--c-text-muted);
}

.hp-form-foot nav {
    display: flex;
    gap: 1.25rem;
}

.hp-form-foot a {
    color: var(--c-text-muted);
    text-decoration: none;
}

.hp-form-foot a:hover {
    color: var(--c-text);
    text-decoration: underline;
}

.hp-form-foot a:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
}

/* Narrow screens: keep the panel short so the form starts sooner */
@media (max-width: 991.98px) {
    .hp-chat,
    .hp-form-foot {
        display: none;
    }

    /* Logins go straight to the form */
    .hp-split:has(> .hp-card--narrow) > .hp-brand-panel {
        display: none;
    }
}

/* Login: compact card (it sits in the same split as the create ticket page) */
.hp-login-head {
    padding: 1.75rem clamp(1.25rem, 4vw, 2rem) 0;
    text-align: center;
}

.hp-login-head img {
    width: 3rem;
    height: auto;
    margin-bottom: 0.875rem;
}

.hp-login-head p {
    margin: 0.25rem 0 0;
    color: var(--c-text-muted);
    text-wrap: pretty;
}

.hp-card--narrow .hp-card-body {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.hp-card--narrow .hp-field {
    margin-bottom: 1rem;
}

/* Thank you page: plain white page with the ticket number as the hero */
body:has(.hp-plain) .pt-navbar {
    padding-top: 0;
}

.hp-plain {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 100dvh;
    padding: 6rem 1.5rem 4rem;
    background: var(--c-surface);
    color: var(--c-text);
    text-align: center;
}

.hp-plain-logo {
    position: absolute;
    top: 1.75rem;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--c-text);
    text-decoration: none;
}

.hp-plain-logo img {
    width: 1.875rem;
    height: auto;
}

.hp-plain-inner {
    max-width: 40rem;
}

.hp-plain-kicker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 0 0 1.125rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--c-accent-hover);
}

/* Check that draws itself once */
.hp-done {
    width: 2rem;
    height: 2rem;
    fill: none;
    stroke: var(--c-accent-hover);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hp-done-circle {
    stroke-dasharray: 202;
    stroke-dashoffset: 202;
    animation: hp-draw 0.5s ease-out forwards;
}

.hp-done-check {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: hp-draw 0.4s ease-out 0.35s forwards;
}

@keyframes hp-draw {
    to {
        stroke-dashoffset: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hp-done-circle,
    .hp-done-check {
        animation: none;
        stroke-dashoffset: 0;
    }
}

.hp-plain-number {
    margin: 0;
    font-size: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
    color: var(--c-text);
    overflow-wrap: anywhere;
}

.hp-plain-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.625rem;
    padding: 0.375rem 0.625rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--c-text-muted);
}

.hp-plain-copy:hover {
    background: var(--c-accent-soft);
    color: var(--c-text);
}

.hp-plain-text {
    max-width: 44ch;
    margin: 1.75rem auto 0;
    font-size: 1.0625rem;
    color: var(--c-text-muted);
}

.hp-plain-text + .hp-plain-text {
    margin-top: 0.75rem;
}

.hp-plain-text strong {
    color: var(--c-text);
}

.hp-plain-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem 1.75rem;
    margin-top: 2rem;
}

@media (max-width: 575.98px) {
    .hp-plain-logo {
        left: 1.25rem;
    }
}

.hp-auth-alt {
    margin: 1.25rem 0 0;
    color: var(--c-text-muted);
    text-align: center;
}

.hp-card--narrow .hp-auth-row {
    margin-bottom: 1.25rem;
}
