/* Support-request flow. Functional WHMCS form selectors stay unchanged. */
body.hg-submit-ticket-page {
    --hg-submit-success: #20845b;
    --hg-submit-success-soft: rgba(32, 132, 91, .09);
}

html[data-bs-theme="dark"] body.hg-submit-ticket-page {
    --hg-submit-success: #55c895;
    --hg-submit-success-soft: rgba(85, 200, 149, .1);
}

body.hg-submit-ticket-page .hg-submit-page {
    min-width: 0;
}

body.hg-submit-ticket-page .hg-submit-hero {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    min-height: 124px;
    margin-bottom: 16px;
    padding: 22px 24px;
    overflow: hidden;
    border: 1px solid var(--hg-record-border);
    border-radius: 20px;
    background:
        radial-gradient(circle at 94% -30%, rgba(164, 52, 193, .18), transparent 16rem),
        linear-gradient(135deg, var(--hg-record-surface), var(--hg-record-soft));
    box-shadow: var(--hg-record-shadow);
}

body.hg-submit-ticket-page .hg-submit-hero::after {
    position: absolute;
    z-index: -1;
    top: -86px;
    right: -40px;
    width: 210px;
    height: 210px;
    border: 1px solid rgba(125, 21, 155, .1);
    border-radius: 50%;
    box-shadow: 0 0 0 30px rgba(125, 21, 155, .035);
    content: "";
}

html[dir="rtl"] body.hg-submit-ticket-page .hg-submit-hero::after {
    right: auto;
    left: -40px;
}

body.hg-submit-ticket-page .hg-submit-hero__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--hg-record-brand-dark), #a629c1);
    box-shadow: 0 10px 24px rgba(125, 21, 155, .24);
    color: #fff;
    font-size: 21px;
}

body.hg-submit-ticket-page .hg-submit-hero__copy {
    min-width: 0;
}

body.hg-submit-ticket-page .hg-submit-hero__eyebrow {
    margin: 0 0 5px;
    color: var(--hg-record-brand);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .065em;
    line-height: 1.3;
    text-transform: uppercase;
}

body.hg-submit-ticket-page #main-body .hg-submit-hero__title {
    margin: 0;
    color: var(--hg-record-text) !important;
    font-size: clamp(21px, 2vw, 28px) !important;
    font-weight: 820 !important;
    letter-spacing: -.025em;
    line-height: 1.18 !important;
}

body.hg-submit-ticket-page .hg-submit-hero__description {
    max-width: 710px;
    margin: 7px 0 0;
    color: var(--hg-record-muted);
    font-size: 13px;
    line-height: 1.55;
}

/* Department selection. */
body.hg-submit-ticket-page .hg-submit-departments {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

body.hg-submit-ticket-page .hg-submit-department {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 18px;
    gap: 13px;
    align-items: center;
    min-height: 118px;
    padding: 17px;
    overflow: hidden;
    border: 1px solid var(--hg-record-border);
    border-radius: 16px;
    background: var(--hg-record-surface);
    box-shadow: 0 7px 22px rgba(31, 24, 50, .045);
    color: var(--hg-record-text) !important;
    text-decoration: none !important;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

body.hg-submit-ticket-page .hg-submit-department::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, var(--hg-record-brand-dark), #bd36ca);
    content: "";
    opacity: 0;
    transition: opacity .16s ease;
}

html[dir="rtl"] body.hg-submit-ticket-page .hg-submit-department::before {
    inset: 0 0 0 auto;
}

body.hg-submit-ticket-page .hg-submit-department:hover,
body.hg-submit-ticket-page .hg-submit-department:focus {
    transform: translateY(-2px);
    border-color: rgba(125, 21, 155, .32);
    box-shadow: 0 13px 30px rgba(69, 30, 85, .1);
}

body.hg-submit-ticket-page .hg-submit-department:hover::before,
body.hg-submit-ticket-page .hg-submit-department:focus::before {
    opacity: 1;
}

body.hg-submit-ticket-page .hg-submit-department__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: rgba(125, 21, 155, .085);
    color: var(--hg-record-brand);
    font-size: 16px;
}

body.hg-submit-ticket-page .hg-submit-department__copy {
    min-width: 0;
}

body.hg-submit-ticket-page .hg-submit-department__name {
    display: block;
    margin-bottom: 5px;
    overflow-wrap: anywhere;
    color: var(--hg-record-text);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
}

body.hg-submit-ticket-page .hg-submit-department__description {
    display: block;
    color: var(--hg-record-muted);
    font-size: 12px;
    line-height: 1.5;
}

body.hg-submit-ticket-page .hg-submit-department__arrow {
    color: var(--hg-record-muted);
    font-size: 12px;
    transition: transform .16s ease, color .16s ease;
}

body.hg-submit-ticket-page .hg-submit-department:hover .hg-submit-department__arrow,
body.hg-submit-ticket-page .hg-submit-department:focus .hg-submit-department__arrow {
    transform: translateX(3px);
    color: var(--hg-record-brand);
}

html[dir="rtl"] body.hg-submit-ticket-page .hg-submit-department__arrow {
    transform: rotate(180deg);
}

html[dir="rtl"] body.hg-submit-ticket-page .hg-submit-department:hover .hg-submit-department__arrow,
html[dir="rtl"] body.hg-submit-ticket-page .hg-submit-department:focus .hg-submit-department__arrow {
    transform: rotate(180deg) translateX(3px);
}

/* Request form. */
body.hg-submit-ticket-page .hg-submit-form-card,
body.hg-submit-ticket-page .hg-submit-confirm-card {
    overflow: hidden;
    margin: 0;
    border: 1px solid var(--hg-record-border);
    border-radius: 20px;
    background: var(--hg-record-surface);
    box-shadow: var(--hg-record-shadow);
}

body.hg-submit-ticket-page .hg-submit-form-card > .card-body {
    padding: 22px 24px !important;
}

body.hg-submit-ticket-page .hg-submit-form-card .alert {
    margin-bottom: 18px;
    border-radius: 13px;
}

body.hg-submit-ticket-page .hg-submit-fields {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
}

body.hg-submit-ticket-page .hg-submit-field {
    grid-column: span 4;
    min-width: 0;
    margin: 0;
}

body.hg-submit-ticket-page .hg-submit-field--name { grid-column: span 5; }
body.hg-submit-ticket-page .hg-submit-field--email { grid-column: span 7; }
body.hg-submit-ticket-page .hg-submit-field--subject { grid-column: 1 / -1; }
body.hg-submit-ticket-page .hg-submit-field--department { grid-column: span 4; }
body.hg-submit-ticket-page .hg-submit-field--service { grid-column: span 5; }
body.hg-submit-ticket-page .hg-submit-field--priority { grid-column: span 3; }

body.hg-submit-ticket-page #main-body .form-group > label,
body.hg-submit-ticket-page #main-body .hg-submit-attachments > label {
    display: block;
    margin: 0 0 7px;
    color: var(--hg-record-text) !important;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .018em;
    line-height: 1.35;
}

body.hg-submit-ticket-page #main-body :is(input.form-control, select.form-control) {
    width: 100%;
    min-height: 44px;
    padding: 9px 13px;
    border: 1px solid var(--hg-record-border) !important;
    border-radius: 11px !important;
    background: var(--hg-record-surface) !important;
    box-shadow: none !important;
    color: var(--hg-record-text) !important;
    font-size: 13px;
}

body.hg-submit-ticket-page #main-body :is(input.form-control, select.form-control):focus {
    border-color: var(--hg-record-brand) !important;
    box-shadow: 0 0 0 3px rgba(125, 21, 155, .12) !important;
}

body.hg-submit-ticket-page #main-body input.form-control:disabled {
    background: var(--hg-record-soft) !important;
    color: var(--hg-record-muted) !important;
    opacity: 1;
}

body.hg-submit-ticket-page .hg-submit-composer {
    margin-top: 19px;
}

body.hg-submit-ticket-page .hg-submit-composer .md-editor {
    overflow: hidden;
    border: 1px solid var(--hg-record-border) !important;
    border-radius: 14px !important;
    background: var(--hg-record-surface) !important;
    box-shadow: none !important;
}

body.hg-submit-ticket-page .hg-submit-composer .md-header {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 49px;
    padding: 7px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--hg-record-border) !important;
    background: var(--hg-record-soft) !important;
}

body.hg-submit-ticket-page .hg-submit-composer .md-header .btn-group {
    display: flex;
    gap: 5px;
    margin: 0 !important;
}

body.hg-submit-ticket-page .hg-submit-composer .md-header .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 34px;
    margin: 0 !important;
    padding: 6px 10px !important;
    border: 1px solid var(--hg-record-border) !important;
    border-radius: 9px !important;
    background: var(--hg-record-surface) !important;
    color: var(--hg-record-text) !important;
    box-shadow: none !important;
}

body.hg-submit-ticket-page .hg-submit-composer .md-header .btn:hover,
body.hg-submit-ticket-page .hg-submit-composer .md-header .btn:focus {
    border-color: rgba(125, 21, 155, .28) !important;
    background: rgba(125, 21, 155, .075) !important;
    color: var(--hg-record-brand) !important;
}

body.hg-submit-ticket-page .hg-submit-composer .md-input,
body.hg-submit-ticket-page .hg-submit-composer textarea {
    min-height: 260px !important;
    padding: 15px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: var(--hg-record-surface) !important;
    color: var(--hg-record-text) !important;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
}

body.hg-submit-ticket-page .hg-submit-composer .md-footer {
    border: 0 !important;
    border-top: 1px solid var(--hg-record-border) !important;
    background: var(--hg-record-soft) !important;
    color: var(--hg-record-muted) !important;
}

body.hg-submit-ticket-page .hg-submit-attachments {
    margin-top: 18px;
    padding: 15px;
    border: 1px solid var(--hg-record-border);
    border-radius: 14px;
    background: var(--hg-record-soft);
}

body.hg-submit-ticket-page .hg-submit-attachments .attachment-group {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    width: 100%;
}

body.hg-submit-ticket-page .hg-submit-attachments .custom-file,
body.hg-submit-ticket-page .hg-submit-attachments .custom-file-input {
    width: 100% !important;
    min-width: 0;
    height: 42px !important;
}

body.hg-submit-ticket-page .hg-submit-attachments .custom-file-label {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 42px;
    padding: 10px 92px 10px 13px;
    overflow: hidden;
    border: 1px solid var(--hg-record-border) !important;
    border-radius: 10px !important;
    background: var(--hg-record-surface) !important;
    color: var(--hg-record-text) !important;
    font-size: 12px;
    line-height: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[dir="rtl"] body.hg-submit-ticket-page .hg-submit-attachments .custom-file-label {
    padding-right: 13px;
    padding-left: 92px;
}

body.hg-submit-ticket-page .hg-submit-attachments .custom-file-label::after {
    height: 40px;
    padding: 10px 13px;
    border: 0 !important;
    border-inline-start: 1px solid var(--hg-record-border) !important;
    background: rgba(125, 21, 155, .07) !important;
    color: var(--hg-record-brand) !important;
    font-weight: 750;
    line-height: 20px;
}

body.hg-submit-ticket-page #btnTicketAttachmentsAdd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 8px 13px;
    border: 1px solid var(--hg-record-border) !important;
    border-radius: 10px !important;
    background: var(--hg-record-surface) !important;
    color: var(--hg-record-text) !important;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

body.hg-submit-ticket-page #fileUploadsContainer .attachment-group {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 8px;
}

body.hg-submit-ticket-page .hg-submit-attachments__help {
    display: block;
    margin-top: 8px;
    color: var(--hg-record-muted);
    font-size: 10.5px;
    line-height: 1.45;
}

body.hg-submit-ticket-page #customFieldsContainer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

body.hg-submit-ticket-page #customFieldsContainer .form-group {
    margin: 0;
}

body.hg-submit-ticket-page #autoAnswerSuggestions:not(.w-hidden) {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--hg-record-border);
    border-radius: 14px;
    background: var(--hg-record-soft);
}

body.hg-submit-ticket-page #autoAnswerSuggestions .card-title {
    margin-bottom: 6px;
    color: var(--hg-record-text) !important;
    font-size: 14px !important;
    font-weight: 800 !important;
}

body.hg-submit-ticket-page #autoAnswerSuggestions .list-group-item {
    border-color: var(--hg-record-border);
    background: var(--hg-record-surface);
}

body.hg-submit-ticket-page #autoAnswerSuggestions .list-group-item a {
    color: var(--hg-record-text) !important;
}

body.hg-submit-ticket-page #autoAnswerSuggestions .list-group-item small {
    display: block;
    margin-top: 4px;
    color: var(--hg-record-muted);
}

body.hg-submit-ticket-page .hg-submit-captcha {
    margin: 18px 0 0;
    padding-top: 17px;
    border-top: 1px solid var(--hg-record-border);
}

body.hg-submit-ticket-page .hg-submit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin: 16px 0 0;
}

body.hg-submit-ticket-page .hg-submit-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    min-width: 112px;
    padding: 9px 16px;
    border-radius: 11px !important;
    font-size: 12px;
    font-weight: 800;
}

body.hg-submit-ticket-page .hg-submit-actions .btn-primary {
    border-color: var(--hg-record-brand) !important;
    background: var(--hg-record-brand) !important;
    box-shadow: 0 8px 19px rgba(125, 21, 155, .2);
    color: #fff !important;
}

body.hg-submit-ticket-page .hg-submit-actions .btn-default {
    border-color: var(--hg-record-border) !important;
    background: var(--hg-record-surface) !important;
    color: var(--hg-record-text) !important;
}

/* Successful creation page. */
body.hg-submit-ticket-page .hg-submit-confirm-card > .card-body {
    padding: 36px 28px !important;
    text-align: center;
}

body.hg-submit-ticket-page .hg-submit-confirm__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 17px;
    border-radius: 20px;
    background: var(--hg-submit-success-soft);
    color: var(--hg-submit-success);
    font-size: 28px;
}

body.hg-submit-ticket-page .hg-submit-confirm-card .alert-success {
    max-width: 600px;
    margin: 0 auto 14px;
    border-color: rgba(32, 132, 91, .2);
    border-radius: 13px;
    background: var(--hg-submit-success-soft);
    color: var(--hg-record-text);
}

body.hg-submit-ticket-page .hg-submit-confirm__description {
    max-width: 620px;
    margin: 0 auto;
    color: var(--hg-record-muted);
    font-size: 13px;
    line-height: 1.65;
}

body.hg-submit-ticket-page .hg-submit-confirm-card .hg-submit-actions {
    justify-content: center;
    margin-top: 22px;
}

body.hg-submit-ticket-page a:focus-visible,
body.hg-submit-ticket-page button:focus-visible,
body.hg-submit-ticket-page input:focus-visible,
body.hg-submit-ticket-page select:focus-visible,
body.hg-submit-ticket-page textarea:focus-visible {
    outline: 3px solid rgba(125, 21, 155, .28) !important;
    outline-offset: 2px;
}

@media (max-width: 991.98px) {
    body.hg-submit-ticket-page .hg-submit-departments {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    body.hg-submit-ticket-page .hg-submit-hero {
        grid-template-columns: 46px minmax(0, 1fr);
        gap: 13px;
        min-height: 0;
        padding: 18px;
        border-radius: 17px;
    }

    body.hg-submit-ticket-page .hg-submit-hero__icon {
        width: 46px;
        height: 46px;
        border-radius: 14px;
        font-size: 18px;
    }

    body.hg-submit-ticket-page #main-body .hg-submit-hero__title {
        font-size: 20px !important;
    }

    body.hg-submit-ticket-page .hg-submit-hero__description {
        font-size: 12px;
    }

    body.hg-submit-ticket-page .hg-submit-department {
        min-height: 104px;
        padding: 15px;
    }

    body.hg-submit-ticket-page .hg-submit-form-card,
    body.hg-submit-ticket-page .hg-submit-confirm-card {
        border-radius: 17px;
    }

    body.hg-submit-ticket-page .hg-submit-form-card > .card-body {
        padding: 18px 16px !important;
    }

    body.hg-submit-ticket-page .hg-submit-field,
    body.hg-submit-ticket-page .hg-submit-field--name,
    body.hg-submit-ticket-page .hg-submit-field--email,
    body.hg-submit-ticket-page .hg-submit-field--subject,
    body.hg-submit-ticket-page .hg-submit-field--department,
    body.hg-submit-ticket-page .hg-submit-field--service,
    body.hg-submit-ticket-page .hg-submit-field--priority {
        grid-column: 1 / -1;
    }

    body.hg-submit-ticket-page .hg-submit-composer .md-header {
        align-items: center;
    }

    body.hg-submit-ticket-page .hg-submit-composer .md-header .btn {
        min-width: 34px;
        padding: 6px 8px !important;
    }

    body.hg-submit-ticket-page .hg-submit-composer .md-input,
    body.hg-submit-ticket-page .hg-submit-composer textarea {
        min-height: 230px !important;
    }

    body.hg-submit-ticket-page .hg-submit-attachments .attachment-group {
        grid-template-columns: minmax(0, 1fr);
    }

    body.hg-submit-ticket-page #btnTicketAttachmentsAdd,
    body.hg-submit-ticket-page .hg-submit-actions .btn {
        width: 100%;
    }

    body.hg-submit-ticket-page #customFieldsContainer {
        grid-template-columns: 1fr;
    }

    body.hg-submit-ticket-page .hg-submit-actions {
        flex-direction: column;
    }

    body.hg-submit-ticket-page .hg-submit-confirm-card > .card-body {
        padding: 30px 18px !important;
    }
}
