/* Popup đăng nhập / đăng ký / hồ sơ — P1 */
.ola-cauth-modal {
    --cauth-green: #15803d;
    --cauth-green-dark: #166534;
    --cauth-green-soft: rgba(21, 128, 61, 0.1);
    --cauth-text: #0f172a;
    --cauth-muted: #64748b;
    --cauth-border: #e2e8f0;
    --cauth-input-bg: #f8fafc;
    --cauth-radius: 14px;
    --cauth-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: var(--cauth-font);
}

.ola-cauth-modal.is-open {
    display: flex;
}

.ola-cauth-modal.is-open .ola-cauth-modal__dialog {
    animation: olaCauthSlideIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes olaCauthSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ola-cauth-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(4px);
}

.ola-cauth-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: min(92vh, 720px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--cauth-radius);
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.06),
        0 24px 48px -12px rgba(15, 23, 42, 0.28);
}

.ola-cauth-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}

.ola-cauth-modal__close:hover {
    background: #e2e8f0;
    color: var(--cauth-text);
}

.ola-cauth-modal__close:focus-visible {
    outline: 2px solid var(--cauth-green);
    outline-offset: 2px;
}

/* Tabs */
.ola-cauth-tabs {
    display: flex;
    flex-shrink: 0;
    gap: 0;
    padding: 20px 24px 0;
    border-bottom: 1px solid var(--cauth-border);
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.ola-cauth-tab {
    flex: 1;
    border: none;
    background: none;
    padding: 12px 8px 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--cauth-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s, border-color 0.2s;
}

.ola-cauth-tab:hover {
    color: #334155;
}

.ola-cauth-tab.is-active {
    color: var(--cauth-green);
    border-bottom-color: var(--cauth-green);
}

/* Scrollable body */
.ola-cauth-body {
    padding: 20px 24px 24px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

#olaCauthAuthWrap.ola-cauth-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}

.ola-cauth-sub {
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--cauth-muted);
    margin: 0 0 14px;
}

/* Google OAuth (P1 popup — không qua B2C) */
.ola-cauth-social {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 4px;
}

.ola-cauth-google-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 0 12px;
}

.ola-cauth-google-row__label {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--cauth-muted);
    margin: 0;
}

.ola-cauth-google-btn--inline {
    width: 28px;
    height: 28px;
    font-size: 14px;
    flex-shrink: 0;
}

.ola-cauth-google-btn--inline:hover {
    transform: none;
}

.ola-cauth-google-btn--inline:active {
    transform: scale(0.96);
}

.ola-cauth-google-btn {
    width: 35px;
    height: 35px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dadce0;
    background: #fff;
    color: #ea4335;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s, background 0.15s;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ola-cauth-google-btn:hover {
    transform: translateY(-2px);
    border-color: #ea4335;
    background: #fef7f6;
    box-shadow: 0 6px 16px rgba(234, 67, 53, 0.15);
}

.ola-cauth-google-btn:focus-visible {
    outline: 2px solid var(--cauth-primary, #0b57d0);
    outline-offset: 2px;
}

.ola-cauth-google-btn.is-loading {
    pointer-events: none;
    opacity: 0.65;
}

.ola-cauth-divider {
    border: none;
    height: 1px;
    margin: 18px 0 20px;
    background: linear-gradient(90deg, transparent, var(--cauth-border) 15%, var(--cauth-border) 85%, transparent);
}

.ola-cauth-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--cauth-text);
    margin: 0 0 16px;
    letter-spacing: -0.01em;
}

/* Fields — chỉ label trực tiếp của .ola-cauth-field */
.ola-cauth-field {
    margin-bottom: 16px;
}

.ola-cauth-field > label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #475569;
    margin-bottom: 8px;
}

.ola-cauth-field > label .req {
    color: #dc2626;
    font-weight: 700;
}

.ola-cauth-field input,
.ola-cauth-field select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--cauth-border);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 15px;
    line-height: 1.4;
    color: var(--cauth-text);
    background: var(--cauth-input-bg);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.ola-cauth-field input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.ola-cauth-field input:hover,
.ola-cauth-field select:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.ola-cauth-field input:focus,
.ola-cauth-field select:focus {
    outline: none;
    border-color: var(--cauth-green);
    background: #fff;
    box-shadow: 0 0 0 3px var(--cauth-green-soft);
}

.ola-cauth-pw-wrap {
    position: relative;
}

.ola-cauth-pw-wrap input {
    padding-right: 44px;
}

.ola-cauth-pw-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--cauth-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
}

.ola-cauth-pw-toggle:hover {
    color: var(--cauth-text);
    background: rgba(15, 23, 42, 0.05);
}

/* Checkbox — hàng ngang, không uppercase */
.ola-cauth-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 18px;
    padding: 2px 0;
}

.ola-cauth-check__input {
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--cauth-green);
    cursor: pointer;
}

.ola-cauth-check__label {
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    user-select: none;
    line-height: 1.4;
}

.ola-cauth-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ola-cauth-msg {
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 14px;
    padding: 11px 14px;
    border-radius: 10px;
    display: none;
}

.ola-cauth-msg.is-error {
    display: block;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.ola-cauth-msg.is-success {
    display: block;
    background: #f0fdf4;
    color: var(--cauth-green-dark);
    border: 1px solid #bbf7d0;
}

/* Nút chính */
.ola-cauth-btn {
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 13px 18px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    background: #e2e8f0;
    color: #94a3b8;
    margin-top: 2px;
    transition: background 0.2s, color 0.2s, transform 0.1s, box-shadow 0.2s;
}

.ola-cauth-btn:not(:disabled) {
    background: var(--cauth-green);
    color: #fff;
    box-shadow: 0 4px 14px rgba(21, 128, 61, 0.35);
}

.ola-cauth-btn:not(:disabled):hover {
    background: var(--cauth-green-dark);
    box-shadow: 0 6px 18px rgba(21, 128, 61, 0.4);
}

.ola-cauth-btn:not(:disabled):active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(21, 128, 61, 0.3);
}

.ola-cauth-btn:disabled {
    cursor: not-allowed;
}

.ola-cauth-link-row {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
}

.ola-cauth-link-row a {
    color: var(--cauth-green);
    text-decoration: none;
    font-weight: 600;
}

.ola-cauth-link-row a:hover {
    text-decoration: underline;
    color: var(--cauth-green-dark);
}

.ola-cauth-terms {
    text-align: center;
    font-size: 12px;
    line-height: 1.55;
    color: var(--cauth-muted);
    margin: 14px 0 0;
}

.ola-cauth-terms a {
    color: var(--cauth-green);
    font-weight: 600;
    text-decoration: none;
}

.ola-cauth-terms a:hover {
    text-decoration: underline;
}

.ola-cauth-panel {
    display: none;
}

.ola-cauth-panel.is-active {
    display: block;
}

/* Hồ sơ */
.ola-cauth-profile {
    padding-top: 8px;
}

.ola-cauth-profile__name {
    font-size: 20px;
    font-weight: 800;
    color: var(--cauth-text);
    margin: 0 0 20px;
    text-align: center;
    letter-spacing: -0.02em;
}

.ola-cauth-profile dl {
    margin: 0 0 22px;
    background: var(--cauth-input-bg);
    border-radius: 12px;
    border: 1px solid var(--cauth-border);
    overflow: hidden;
}

.ola-cauth-profile dt {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cauth-muted);
    padding: 12px 16px 4px;
    margin: 0;
}

.ola-cauth-profile dt:first-child {
    padding-top: 14px;
}

.ola-cauth-profile dd {
    margin: 0;
    padding: 0 16px 12px;
    font-size: 14px;
    color: #334d88;
    /* font-weight: 600;*/
    line-height: 1.45;
    border-bottom: 1px solid var(--cauth-border);
}

.ola-cauth-profile dd:last-of-type {
    border-bottom: none;
    padding-bottom: 14px;
}

.ola-cauth-profile__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ola-cauth-btn--outline {
    background: #fff !important;
    color: #334155 !important;
    border: 1px solid var(--cauth-border) !important;
    box-shadow: none !important;
}

.ola-cauth-btn--outline:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

.ola-cauth-btn--danger {
    background: #fff !important;
    color: #b91c1c !important;
    border: 1px solid #fecaca !important;
    box-shadow: none !important;
}

.ola-cauth-btn--danger:hover {
    background: #fef2f2 !important;
}

@media (max-width: 480px) {
    .ola-cauth-modal {
        padding: 12px;
        align-items: flex-end;
    }

    .ola-cauth-modal__dialog {
        max-height: 94vh;
        border-radius: var(--cauth-radius) var(--cauth-radius) 0 0;
    }

    .ola-cauth-body {
        padding: 16px 18px 22px;
    }

    .ola-cauth-tabs {
        padding: 16px 18px 0;
    }

    .ola-cauth-row-2 {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ola-cauth-modal.is-open .ola-cauth-modal__dialog {
        animation: none;
    }
}
