/*
 * Smart Art unified authentication offcanvas.
 * Scoped to #authOffcanvas / #authOffcanvasOverlay only; no global overrides.
 * By Fatehi — 2026-11-27
 */

#authOffcanvasOverlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    background: color-mix(in srgb, var(--dark, #292933) 60%, transparent);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: default;
}

#authOffcanvasOverlay.active {
    opacity: 1;
    visibility: visible;
}

#authOffcanvas {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1055;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    height: 100dvh;
    background: var(--white, #fff);
    box-shadow: rgba(50, 50, 93, 0.4) 0 50px 100px -20px;
    transform: translateX(100%);
    transition: transform 0.4s ease;
    overflow: hidden;
    color: var(--dark, #292933);
    font-family: "GE SS Two", sans-serif;
    font-weight: 500;
}

html[dir="rtl"] #authOffcanvas,
#authOffcanvas[dir="rtl"] {
    right: auto;
    left: 0;
    transform: translateX(-100%);
}

#authOffcanvas.active,
html[dir="rtl"] #authOffcanvas.active,
#authOffcanvas[dir="rtl"].active {
    transform: translateX(0);
}

/* Keep icon fonts on their own faces; GE SS Two is for text only. */
#authOffcanvas i,
#authOffcanvas [class*="la-"] {
    font-family: "Line Awesome Free", "Line Awesome Brands", sans-serif;
    font-weight: 900;
}

#authOffcanvas .auth-offcanvas__header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 8px 20px;
    border-bottom: 1px solid var(--soft-light, #dfdfe6);
}

#authOffcanvas .auth-offcanvas__brand {
    font-size: 15px;
    color: var(--primary, #a42956);
}

#authOffcanvas .auth-offcanvas__icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--dark, #292933);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

#authOffcanvas .auth-offcanvas__icon-btn:hover {
    background: var(--soft-primary, rgba(164, 41, 86, 0.15));
    color: var(--primary, #a42956);
}

#authOffcanvas .auth-offcanvas__icon-btn[hidden] {
    display: none;
}

#authOffcanvas .auth-back-rtl,
html[dir="ltr"] #authOffcanvas .auth-back-rtl {
    display: none;
}

html[dir="rtl"] #authOffcanvas .auth-back-rtl,
#authOffcanvas[dir="rtl"] .auth-back-rtl {
    display: inline-block;
}

html[dir="rtl"] #authOffcanvas .auth-back-ltr,
#authOffcanvas[dir="rtl"] .auth-back-ltr {
    display: none;
}

#authOffcanvas .auth-offcanvas__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 28px 28px calc(32px + env(safe-area-inset-bottom));
}

#authOffcanvas [data-auth-step] {
    display: none;
}

#authOffcanvas [data-auth-step].active {
    display: block;
}

#authOffcanvas .auth-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 92px;
    height: 92px;
    margin: 18px auto 0;
    border-radius: 50%;
    background: var(--soft-light, #efeff3);
    color: var(--primary, #a42956);
    font-size: 40px;
}

#authOffcanvas .auth-title {
    margin: 28px 0 0;
    font-size: 22px;
    line-height: 1.5;
    font-weight: 500;
    text-align: center;
}

#authOffcanvas .auth-subtitle {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.7;
    color: var(--gray, #6c757d);
    text-align: center;
}

#authOffcanvas .auth-method-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 34px;
}

#authOffcanvas .auth-method-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 104px;
    padding: 16px 8px;
    border: 1px solid var(--soft-secondary, rgba(143, 151, 171, 0.35));
    border-radius: 12px;
    background: var(--white, #fff);
    color: var(--dark, #292933);
    font-family: inherit;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

#authOffcanvas .auth-method-card i {
    font-size: 28px;
    color: var(--primary, #a42956);
}

#authOffcanvas .auth-method-card:hover,
#authOffcanvas .auth-method-card:focus-visible {
    border-color: var(--primary, #a42956);
    background: var(--soft-primary, rgba(164, 41, 86, 0.08));
    outline: none;
}

#authOffcanvas .auth-form {
    margin-top: 24px;
}

#authOffcanvas .auth-field {
    margin-bottom: 16px;
}

#authOffcanvas .auth-field > label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--dark, #292933);
}

#authOffcanvas .auth-control {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--soft-secondary, rgba(143, 151, 171, 0.35));
    border-radius: 8px;
    background: var(--white, #fff);
    color: var(--dark, #292933);
    font-family: inherit;
    font-size: 14px;
}

#authOffcanvas .auth-control:focus {
    border-color: var(--primary, #a42956);
    outline: none;
    box-shadow: 0 0 0 3px var(--soft-primary, rgba(164, 41, 86, 0.15));
}

#authOffcanvas .auth-control:disabled {
    background: var(--soft-light, #efeff3);
    cursor: not-allowed;
}

#authOffcanvas .auth-phone-row {
    display: flex;
    align-items: stretch;
}

#authOffcanvas .auth-phone-row .iti {
    flex: 1 1 auto;
    width: 100%;
}

/* By Fatehi — 2026-11-27: RTL country list inside the panel without horizontal page overflow. */
#authOffcanvas .iti--separate-dial-code .iti__flag-container {
    left: 0;
    right: 0;
    width: 100%;
    pointer-events: none;
}

#authOffcanvas .iti--separate-dial-code .iti__selected-flag {
    width: max-content;
    max-width: 80px;
    pointer-events: auto;
}

#authOffcanvas .iti__country-list {
    pointer-events: auto;
    left: auto !important;
    right: 0 !important;
    margin: 0 -1px 0 0 !important;
    direction: rtl;
    text-align: right;
    width: max-content;
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
    overflow-x: hidden;
    white-space: normal;
}

#authOffcanvas .iti__country-list .iti__country {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    direction: rtl;
    text-align: right;
    gap: 6px;
}

#authOffcanvas .iti__country-list .iti__country .iti__flag-box,
#authOffcanvas .iti__country-list .iti__country .iti__country-name {
    margin-right: 0;
    margin-left: 0;
}

#authOffcanvas .iti__country-list .iti__country .iti__country-name {
    overflow-wrap: anywhere;
}

#authOffcanvas .auth-phone-row .auth-control {
    width: 100%;
}

#authOffcanvas .auth-password-wrap {
    position: relative;
}

#authOffcanvas .auth-password-wrap .auth-control {
    padding-right: 44px;
    padding-left: 44px;
}

#authOffcanvas .auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--gray, #6c757d);
    cursor: pointer;
    font-size: 18px;
}

html[dir="rtl"] #authOffcanvas .auth-password-toggle,
#authOffcanvas[dir="rtl"] .auth-password-toggle {
    right: auto;
    left: 8px;
}

#authOffcanvas .auth-primary-btn {
    display: block;
    width: 100%;
    min-height: 48px;
    margin-top: 8px;
    border: 0;
    border-radius: 8px;
    background: var(--primary, #a42956);
    color: var(--white, #fff);
    font-family: inherit;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

#authOffcanvas .auth-primary-btn:hover:not(:disabled) {
    background: var(--hov-primary, #7d1e41);
}

#authOffcanvas .auth-primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#authOffcanvas .auth-link-btn {
    display: inline-block;
    padding: 4px;
    border: 0;
    background: transparent;
    color: var(--primary, #a42956);
    font-family: inherit;
    font-weight: 500;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}

#authOffcanvas .auth-link-btn:hover {
    text-decoration: underline;
}

#authOffcanvas .auth-form-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

#authOffcanvas .auth-method-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 28px;
    flex-wrap: wrap;
}

#authOffcanvas .auth-masked {
    display: block;
    margin-top: 10px;
    font-size: 14px;
    color: var(--gray, #6c757d);
    text-align: center;
    direction: ltr;
}

#authOffcanvas .auth-otp-input {
    text-align: center;
    direction: ltr;
    font-size: 22px;
    letter-spacing: 8px;
    padding-left: 22px;
}

#authOffcanvas .auth-otp-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    font-size: 13px;
    color: var(--gray, #6c757d);
    flex-wrap: wrap;
}

#authOffcanvas .auth-message {
    min-height: 20px;
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--red, #dc3545);
}

#authOffcanvas .auth-message[data-tone="info"] {
    color: var(--gray, #6c757d);
}

#authOffcanvas .auth-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    line-height: 1.7;
}

#authOffcanvas .auth-checkbox input {
    margin-top: 4px;
}

@media (max-width: 575px) {
    #authOffcanvas {
        max-width: none;
        padding-bottom: env(safe-area-inset-bottom);
    }

    #authOffcanvas .auth-offcanvas__body {
        padding: 20px 20px calc(28px + env(safe-area-inset-bottom));
    }

    #authOffcanvas .auth-method-card {
        min-height: 96px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #authOffcanvas,
    #authOffcanvasOverlay,
    #authOffcanvas .auth-offcanvas__icon-btn,
    #authOffcanvas .auth-method-card,
    #authOffcanvas .auth-primary-btn {
        transition: none;
    }
}

/* By Fatehi — 2026-11-27 */
