
/* =========================================
   AVIO ERP - GLOBAL FREE TRIAL PROMOTION
========================================== */

.avio-trial-promo {
    --trial-primary: var(--avio-accent-3, #9256F5);
    --trial-secondary: var(--avio-accent-4, #EB429B);
    --trial-text: #ffffff;

    position: relative;
    z-index: 9998;
}

/* =========================================
   FLOATING BUTTON
========================================== */

.avio-trial-float {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9998;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    padding: 13px 20px;

    border: 0;
    border-radius: 50px;

    color: #ffffff;

    background: linear-gradient(
        135deg,
        var(--trial-primary),
        var(--trial-secondary)
    );

    box-shadow:
        0 8px 28px rgba(100, 40, 180, .32),
        0 0 0 1px rgba(255,255,255,.12);

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    transition:
        transform .3s ease,
        box-shadow .3s ease;
}

.avio-trial-float:hover {
    transform: translateY(-4px);

    box-shadow:
        0 12px 35px rgba(100, 40, 180, .42);
}

.avio-trial-float-icon {
    font-size: 18px;
}

.avio-trial-float-days {
    padding: 4px 8px;

    border-radius: 20px;

    background: rgba(255,255,255,.20);

    font-size: 10px;
}

/* =========================================
   NOTIFICATION TOAST
========================================== */

.avio-trial-toast {
    position: fixed;

    right: 24px;
    bottom: 90px;

    z-index: 9999;

    width: min(390px, calc(100vw - 32px));

    padding: 23px;

    border: 1px solid rgba(146, 86, 245, .25);
    border-radius: 20px;

    background: #ffffff;

    color: #172033;

    box-shadow:
        0 18px 60px rgba(20, 10, 40, .20);

    opacity: 0;
    visibility: hidden;

    transform: translateY(18px) scale(.97);

    pointer-events: none;

    transition:
        opacity .35s ease,
        visibility .35s ease,
        transform .35s ease;
}

.avio-trial-toast.is-visible {
    opacity: 1;
    visibility: visible;

    transform: translateY(0) scale(1);

    pointer-events: auto;
}

/* =========================================
   CLOSE BUTTON
========================================== */

.avio-trial-close {
    position: absolute;

    top: 11px;
    right: 13px;

    width: 29px;
    height: 29px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #f1f0f5;

    color: #5d5470;

    font-size: 22px;
    line-height: 1;

    cursor: pointer;

    transition:
        background .2s ease,
        color .2s ease;
}

.avio-trial-close:hover {
    background: #e8ddfa;
    color: #6b21a8;
}

/* =========================================
   NOTIFICATION CONTENT
========================================== */

.avio-trial-toast-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.avio-trial-icon {
    width: 43px;
    height: 43px;

    flex: 0 0 43px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 13px;

    background: linear-gradient(
        135deg,
        var(--trial-primary),
        var(--trial-secondary)
    );

    color: #ffffff;

    font-size: 23px;

    box-shadow:
        0 6px 18px rgba(120, 60, 200, .22);
}

.avio-trial-toast-text {
    flex: 1;
    min-width: 0;
}

.avio-trial-label {
    display: inline-block;

    margin-bottom: 7px;

    color: #8b35d6;

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.3px;
}

.avio-trial-toast-text h3 {
    margin: 0 22px 8px 0;

    color: #172033;

    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
}

.avio-trial-toast-text p {
    margin: 0 0 15px;

    color: #64748b;

    font-size: 12px;
    line-height: 1.7;
}

/* =========================================
   CTA BUTTON
========================================== */

.avio-trial-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    width: 100%;

    padding: 12px 15px;

    border-radius: 10px;

    background: linear-gradient(
        135deg,
        var(--trial-primary),
        var(--trial-secondary)
    );

    color: #ffffff !important;

    font-size: 12px;
    font-weight: 700;

    text-decoration: none !important;

    transition:
        transform .25s ease,
        box-shadow .25s ease;
}

.avio-trial-cta:hover {
    transform: translateY(-2px);

    box-shadow:
        0 7px 20px rgba(120, 60, 200, .28);
}

.avio-trial-note {
    display: block;

    margin-top: 10px;

    color: #8993a4;

    font-size: 10px;
    text-align: center;
}

/* =========================================
   DARK THEME
========================================== */

html[data-theme="dark"] .avio-trial-toast {
    background: #151326;

    border-color: rgba(146, 86, 245, .30);

    color: #ffffff;
}

html[data-theme="dark"] .avio-trial-toast-text h3 {
    color: #ffffff;
}

html[data-theme="dark"] .avio-trial-toast-text p {
    color: #b7b1c8;
}

html[data-theme="dark"] .avio-trial-close {
    background: #29233c;
    color: #ffffff;
}

html[data-theme="dark"] .avio-trial-note {
    color: #a59bb9;
}

/* =========================================
   MOBILE RESPONSIVE
========================================== */

@media (max-width: 600px) {

    .avio-trial-float {
        right: 14px;
        bottom: 16px;

        padding: 11px 15px;

        font-size: 11px;
    }

    .avio-trial-toast {
        right: 12px;
        bottom: 76px;

        width: calc(100vw - 24px);

        padding: 19px;

        border-radius: 17px;
    }

    .avio-trial-toast-content {
        gap: 11px;
    }

    .avio-trial-icon {
        width: 36px;
        height: 36px;

        flex-basis: 36px;

        font-size: 19px;
    }

    .avio-trial-toast-text h3 {
        font-size: 15px;
    }

    .avio-trial-toast-text p {
        font-size: 11px;
    }
}

/* =========================================
   ACCESSIBILITY
========================================== */

@media (prefers-reduced-motion: reduce) {

    .avio-trial-toast,
    .avio-trial-float,
    .avio-trial-cta {
        transition: none !important;
    }
}

/* =========================================
   ACCESSIBILITY - KEYBOARD FOCUS
========================================== */

.avio-trial-float:focus-visible,
.avio-trial-close:focus-visible,
.avio-trial-cta:focus-visible {
    outline: 3px solid #9256F5;
    outline-offset: 4px;
}


/* =========================================
   AVIO ERP - FLOATING WIDGET POSITION FIX
   AI Assistant above Free Trial
========================================== */

/* AI Assistant - Keep above Free Trial */
.avio-ai {
    position: fixed !important;
    right: 24px !important;
    bottom: 100px !important;
    z-index: 10000 !important;
}

/* Free Trial - Keep below AI Assistant */
.avio-trial-promo {
    z-index: 9998;
}

.avio-trial-float {
    right: 24px !important;
    bottom: 24px !important;
    z-index: 9998 !important;
}

/* Notification appears above both widgets */
.avio-trial-toast {
    right: 24px !important;
    bottom: 170px !important;
    z-index: 10001 !important;
}

/* Mobile positioning */
@media (max-width: 600px) {
    .avio-ai {
        right: 14px !important;
        bottom: 88px !important;
    }

    .avio-trial-float {
        right: 14px !important;
        bottom: 16px !important;
    }

    .avio-trial-toast {
        right: 12px !important;
        bottom: 150px !important;
        width: calc(100vw - 24px);
    }
}


/* =========================================
   AVIO ERP - MAIN FREE TRIAL MODAL
========================================== */

.avio-main-trial-modal {
    position: fixed;
    inset: 0;
    z-index: 20000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity .3s ease,
        visibility .3s ease;
}

.avio-main-trial-modal.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Background Overlay */

.avio-main-trial-overlay {
    position: absolute;
    inset: 0;

    background: rgba(15, 8, 30, .78);
    backdrop-filter: blur(6px);
}

/* Main Form Card */

.avio-main-trial-card {
    position: relative;
    z-index: 2;

    width: min(100%, 600px);
    max-height: 90vh;
    overflow-y: auto;

    padding: 34px;

    border: 1px solid rgba(146, 86, 245, .25);
    border-radius: 22px;

    background: #ffffff;
    color: #172033;

    box-shadow: 0 25px 90px rgba(0, 0, 0, .35);

    transform: translateY(25px) scale(.97);
    transition: transform .3s ease;
}

.avio-main-trial-modal.is-visible .avio-main-trial-card {
    transform: translateY(0) scale(1);
}

/* Close Button */

.avio-main-trial-close {
    position: absolute;
    top: 15px;
    right: 17px;

    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 50%;

    background: #f1eafa;
    color: #7132b5;

    font-size: 25px;
    line-height: 1;

    cursor: pointer;
    transition: background .2s ease;
}

.avio-main-trial-close:hover {
    background: #e5d5fa;
}

/* Header */

.avio-main-trial-header {
    margin-bottom: 24px;
    padding-right: 25px;
}

.avio-main-trial-header h2 {
    margin: 5px 0 9px;

    color: #26113e;

    font-size: clamp(23px, 4vw, 30px);
    font-weight: 800;
    line-height: 1.25;
}

.avio-main-trial-header p {
    margin: 0;

    color: #6b6477;

    font-size: 14px;
    line-height: 1.7;
}

/* Registration Form */

.avio-main-trial-card .auth-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.avio-main-trial-card .auth-form .field {
    min-width: 0;
    margin: 0;
}

.avio-main-trial-card .auth-form .field:nth-last-of-type(1) {
    grid-column: 1 / -1;
}

.avio-main-trial-card .auth-form input:not([type="checkbox"]) {
    width: 100%;
    box-sizing: border-box;
}

.avio-main-trial-card .auth-form .check,
.avio-main-trial-card .auth-form .f-err,
.avio-main-trial-card .auth-form button[type="submit"] {
    grid-column: 1 / -1;
}

.avio-main-trial-card .auth-form button[type="submit"] {
    width: 100%;
    margin-top: 5px;
}

/* Footer */

.avio-main-trial-footer {
    margin: 20px 0 0;

    color: #71677e;

    font-size: 13px;
    text-align: center;
}

.avio-main-trial-footer a {
    color: #8139d6;
    font-weight: 700;
    text-decoration: none;
}

/* Prevent Background Scrolling */

body.avio-trial-modal-open {
    overflow: hidden;
}

/* Dark Theme */

html[data-theme="dark"] .avio-main-trial-card {
    background: #151326;
    color: #ffffff;
    border-color: rgba(146, 86, 245, .35);
}

html[data-theme="dark"] .avio-main-trial-header h2 {
    color: #ffffff;
}

html[data-theme="dark"] .avio-main-trial-header p,
html[data-theme="dark"] .avio-main-trial-footer {
    color: #c0b7d0;
}

html[data-theme="dark"] .avio-main-trial-close {
    background: #302541;
    color: #ffffff;
}

/* Mobile Responsive */

@media (max-width: 600px) {
    .avio-main-trial-modal {
        padding: 12px;
    }

    .avio-main-trial-card {
        width: 100%;
        max-height: 92vh;

        padding: 25px 19px;

        border-radius: 17px;
    }

    .avio-main-trial-header {
        margin-bottom: 19px;
    }

    .avio-main-trial-header h2 {
        font-size: 23px;
    }

    .avio-main-trial-header p {
        font-size: 12px;
    }

    .avio-main-trial-card .auth-form {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .avio-main-trial-card .auth-form .field,
    .avio-main-trial-card .auth-form .check,
    .avio-main-trial-card .auth-form .f-err,
    .avio-main-trial-card .auth-form button[type="submit"] {
        grid-column: 1;
    }
}

/* Accessibility */

.avio-main-trial-close:focus-visible {
    outline: 3px solid #9256F5;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .avio-main-trial-modal,
    .avio-main-trial-card {
        transition: none !important;
    }
}


/* =========================================
   INTERNATIONAL PHONE INPUT - AVIO ERP
========================================== */

.avio-trial-form .iti {
    width: 100%;
    display: block;
}

.avio-trial-form .iti input[type="tel"] {
    width: 100%;
    min-height: 48px;
    box-sizing: border-box;
    padding-left: 95px !important;
}

.avio-trial-form .iti__country-container {
    z-index: 5;
}

.avio-trial-form .iti__selected-country {
    border-radius: 8px 0 0 8px;
}

.avio-trial-form .iti__dropdown-content {
    z-index: 30000;
    max-width: min(320px, 85vw);
}

.avio-trial-form .iti__search-input {
    width: 100%;
    box-sizing: border-box;
}

html[data-theme="dark"] .avio-trial-form .iti__country-list {
    background: #151326;
    color: #ffffff;
    border-color: rgba(146, 86, 245, .35);
}

html[data-theme="dark"] .avio-trial-form .iti__country:hover,
html[data-theme="dark"] .avio-trial-form .iti__country.iti__highlight {
    background: #302541;
}

html[data-theme="dark"] .avio-trial-form .iti__dial-code {
    color: #b7b1c8;
}

@media (max-width: 600px) {
    .avio-trial-form .iti__dropdown-content {
        max-width: 80vw;
    }
}

/* Phone input alignment fix */

.avio-trial-form .iti {
    display: block;
    width: 100%;
}

.avio-trial-form .iti input[type="tel"] {
    display: block;
    width: 100%;
    height: 58px !important;
    min-height: 58px !important;
    box-sizing: border-box;
    padding-left: 100px !important;
    border: 1px solid #dbe3f0 !important;
    border-radius: 18px !important;
    background: #ffffff;
    color: #1d2939;
    font: inherit;
    outline: none;
}

.avio-trial-form .iti input[type="tel"]:focus {
    border-color: #a855f7 !important;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.10);
}

.avio-trial-form .iti__country-container {
    height: 100%;
}

.avio-trial-form .iti__selected-country {
    height: 100%;
}
