/* ─────────────────────────────────────────────────────────────
   Techvizo Account Access – Frontend Styles
───────────────────────────────────────────────────────────── */

.tvzaa-widget {
    display: flex;
    width: 100%;
}

.tvzaa-widget,
.tvzaa-widget * {
    box-sizing: border-box;
}

.tvzaa-widget__inner {
    width: 100%;
}

/* ── Auth Buttons (single combined trigger) ───────────────── */

.tvzaa-auth-buttons {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tvzaa-auth-buttons .tvzaa-submit {
    width: auto;
}

.tvzaa-combined-action {
    /* no forced min-width – let width control or content decide */
}

/* ── Modal ────────────────────────────────────────────────── */

.tvzaa-auth__forms {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.tvzaa-auth-modal {
    position: fixed;
    z-index: 100000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
}

.tvzaa-auth-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.tvzaa-auth-modal__overlay {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(17, 24, 39, .58);
    cursor: pointer;
}

.tvzaa-auth-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 460px);
    max-height: calc(100vh - 44px);
    overflow: auto;
    border: 1px solid #e6e9f0;
    border-radius: 12px;
    background: #fff;
    padding: 30px;
    box-shadow: 0 28px 80px rgba(17, 24, 39, .22);
    transform: translateY(12px) scale(.98);
    transition: transform .2s ease;
}

.tvzaa-auth-modal.is-open .tvzaa-auth-modal__dialog {
    transform: translateY(0) scale(1);
}

.tvzaa-auth-modal__close {
    appearance: none;
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: 1px solid #e6e9f0;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease;
}

.tvzaa-auth-modal__close:hover {
    background: #f7f8fb;
    border-color: #d1d5db;
}

/* ── Reset password link (inside login form) ──────────────── */

.tvzaa-reset-link {
    display: inline-block;
    color: #ef2528;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.tvzaa-reset-link:hover {
    text-decoration: underline;
    color: #d71920;
}

/* ── Password field with eye toggle ──────────────────────── */

.tvzaa-field--password {
    position: relative;
}

.tvzaa-field--password input {
    padding-right: 44px;
}

.tvzaa-pwd-toggle {
    position: absolute;
    right: 12px;
    bottom: 0;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 0 2px;
    transition: color .18s ease;
    line-height: 1;
}

.tvzaa-pwd-toggle:hover {
    color: #374151;
}

.tvzaa-pwd-toggle svg {
    width: 18px;
    height: 18px;
    display: block;
    pointer-events: none;
}

.tvzaa-pwd-toggle .tvzaa-eye-off {
    display: none;
}

.tvzaa-pwd-toggle.is-visible .tvzaa-eye-on {
    display: none;
}

.tvzaa-pwd-toggle.is-visible .tvzaa-eye-off {
    display: block;
}

.tvzaa-auth-modal__close::before,
.tvzaa-auth-modal__close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 2px;
    border-radius: 999px;
    background: #111827;
}

.tvzaa-auth-modal__close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.tvzaa-auth-modal__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.tvzaa-auth-modal .tvzaa-form {
    display: none;
}

.tvzaa-auth-modal .tvzaa-form.is-active {
    display: grid;
}

.tvzaa-auth-modal .tvzaa-card {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
}

body.tvzaa-modal-open {
    overflow: hidden;
}

/* ── Card ─────────────────────────────────────────────────── */

.tvzaa-card,
.tvzaa-account-menu {
    border: 1px solid #e6e9f0;
    border-radius: 10px;
    background: #fff;
    padding: 24px;
    box-shadow: 0 14px 36px rgba(17, 24, 39, .07);
}

.tvzaa-form {
    gap: 14px;
}

.tvzaa-card__title {
    margin: 0 0 16px;
    color: #111827;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.15;
}

/* ── Auth Tabs ────────────────────────────────────────────── */

.tvzaa-auth-tabs {
    display: inline-flex;
    gap: 4px;
    margin-bottom: 18px;
    border-radius: 999px;
    background: #f1f3f7;
    padding: 4px;
}

.tvzaa-auth-tabs__button {
    appearance: none;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #667085;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    padding: 9px 20px;
    transition: background .18s ease, color .18s ease;
}

.tvzaa-auth-tabs__button.is-active,
.tvzaa-auth-tabs__button:hover {
    background: #ef2528;
    color: #fff;
}

/* ── Fields ───────────────────────────────────────────────── */

.tvzaa-field {
    display: grid;
    gap: 7px;
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}

.tvzaa-field input {
    width: 100%;
    min-height: 46px;
    border: 1px solid #dce2ec;
    border-radius: 7px;
    background: #fff;
    color: #111827;
    padding: 0 14px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.tvzaa-field input:focus {
    border-color: #ef2528;
    box-shadow: 0 0 0 3px rgba(239, 37, 40, .13);
}

.tvzaa-form__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.tvzaa-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #667085;
    font-size: 13px;
}

.tvzaa-lost-password {
    color: #ef2528;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

/* ── Buttons ──────────────────────────────────────────────── */

.tvzaa-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 8px;
    background: #ef2528;
    color: #fff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 800;
    padding: 0 22px;
    transition: transform .18s ease, background .18s ease, opacity .18s ease, box-shadow .18s ease;
    box-shadow: 0 4px 14px rgba(239, 37, 40, .3);
}

.tvzaa-submit:hover {
    background: #d71920;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(239, 37, 40, .4);
}

.tvzaa-submit.is-loading {
    opacity: .72;
    cursor: wait;
}

.tvzaa-button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.tvzaa-button-icon svg {
    width: 1em;
    height: 1em;
}

/* ── Messages ─────────────────────────────────────────────── */

.tvzaa-message {
    min-height: 0;
    color: #667085;
    font-size: 13px;
    font-weight: 700;
}

.tvzaa-message.is-success { color: #138a43; }
.tvzaa-message.is-error   { color: #d71920; }

/* ── Account Dropdown ─────────────────────────────────────── */

.tvzaa-account-dropdown {
    position: relative;
    display: inline-flex;
    width: auto;
    max-width: 100%;
}

.tvzaa-account-trigger {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    max-width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #111827;
    cursor: pointer;
    padding: 6px 14px 6px 8px;
    text-align: left;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.tvzaa-account-trigger:hover,
.tvzaa-account-dropdown.is-open .tvzaa-account-trigger {
    border-color: #ef2528;
    box-shadow: 0 8px 24px rgba(17, 24, 39, .1);
}

/* Avatar circle */
.tvzaa-account-trigger__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ef2528;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
}

/* Avatar-only trigger: tighter padding */
.tvzaa-trigger--avatar .tvzaa-account-trigger {
    padding: 4px 10px 4px 4px;
    min-height: 46px;
}

/* Icon-only trigger */
.tvzaa-trigger--icon .tvzaa-account-trigger {
    padding: 8px 14px;
    min-height: 44px;
}

.tvzaa-account-trigger__icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
}

.tvzaa-account-trigger__icon-only svg {
    width: 1em;
    height: 1em;
}

/* Full user info */
.tvzaa-account-trigger__user {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tvzaa-account-trigger__name,
.tvzaa-account-trigger__email {
    display: block;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tvzaa-account-trigger__name {
    color: currentColor;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.15;
}

.tvzaa-account-trigger__email {
    margin-top: 2px;
    color: #667085;
    font-size: 12px;
    line-height: 1.15;
}

/* Chevron */
.tvzaa-account-trigger__chevron {
    display: inline-block;
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    margin: -3px 1px 0 0;
    transform: rotate(45deg);
    transition: transform .18s ease;
    opacity: .6;
}

.tvzaa-account-dropdown.is-open .tvzaa-account-trigger__chevron {
    margin-top: 3px;
    transform: rotate(225deg);
}

/* ── Account Menu Panel ───────────────────────────────────── */

.tvzaa-account-menu {
    position: absolute;
    z-index: 9999;
    top: calc(100% + 10px);
    right: 0;
    width: max-content;
    min-width: 220px;
    max-width: min(300px, calc(100vw - 28px));
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

/* No heading styles needed — heading is removed in HTML */

.tvzaa-account-dropdown.is-open .tvzaa-account-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tvzaa-account-menu__list,
.tvzaa-account-menu .menu {
    display: grid;
    gap: 3px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tvzaa-account-menu li {
    margin: 0;
    padding: 0;
}

.tvzaa-account-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    border-radius: 7px;
    background: #f7f8fb;
    color: #111827;
    font-weight: 700;
    font-size: 14px;
    padding: 0 14px;
    text-decoration: none;
    transition: background .18s ease, color .18s ease;
}

.tvzaa-account-menu .sub-menu {
    display: grid;
    gap: 4px;
    margin: 4px 0 0 12px;
    padding: 0;
    list-style: none;
}

.tvzaa-account-menu a:hover {
    background: #ef2528;
    color: #fff;
}

/* Logout link separator */
.tvzaa-logout-list {
    margin-top: 6px !important;
    padding-top: 6px !important;
    border-top: 1px solid #f0f2f7;
}

.tvzaa-account-menu .tvzaa-logout-link {
    color: #6b7280;
}

.tvzaa-account-menu .tvzaa-logout-link:hover {
    background: #ef2528;
    color: #fff;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 767px) {
    .tvzaa-auth-buttons {
        width: 100%;
    }

    .tvzaa-auth-buttons .tvzaa-submit {
        flex: 1 1 0;
    }

    .tvzaa-auth-modal {
        align-items: flex-start;
        padding: 16px;
    }

    .tvzaa-auth-modal__dialog {
        width: 100%;
        max-height: calc(100vh - 32px);
        padding: 22px;
    }

    .tvzaa-account-dropdown {
        width: 100%;
    }

    .tvzaa-account-trigger {
        width: 100%;
        justify-content: flex-start;
    }

    .tvzaa-trigger--avatar .tvzaa-account-trigger,
    .tvzaa-trigger--icon .tvzaa-account-trigger {
        width: auto;
    }

    .tvzaa-account-menu {
        left: 0;
        right: auto;
        width: 100%;
        min-width: 0;
    }
}
