/**
 * Financial Reader Cabinet: CSS Styles
 */

/* 1. Скрытие системного отступа Admin Bar */
body.frc-hide-bar {
    margin-top: 0 !important;
}
#wpadminbar.frc-force-hidden {
    display: none !important;
}

/* 2. Контейнер виджета в шапке */
.frc-user-cabinet-widget {
    display: inline-flex;
    align-items: center;
    position: relative;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    z-index: 99;
}

/* Элемент внутри меню Astra */
.menu-item.frc-menu-item-wrap {
    display: inline-flex !important;
    align-items: center !important;
    padding: 0 10px !important;
}

/* 3. Кнопка «Войти» для гостя */
.frc-btn-login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    background: #0284c7;
    color: #ffffff !important;
    border: none;
    border-radius: 20px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.22s ease-in-out;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.frc-btn-login:hover {
    background: #0369a1;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.35);
    color: #ffffff !important;
}

.frc-login-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 4. Кнопка профиля для авторизованного читателя */
.frc-btn-profile {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 5px;
    background: #f1f5f9;
    color: #1e293b !important;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.frc-btn-profile:hover,
.frc-btn-profile[aria-expanded="true"] {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.frc-avatar-thumb img {
    border-radius: 50%;
    display: block;
    width: 26px;
    height: 26px;
    object-fit: cover;
}

.frc-user-name {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.frc-caret {
    transition: transform 0.2s ease;
    color: #64748b;
}

.frc-btn-profile[aria-expanded="true"] .frc-caret {
    transform: rotate(180deg);
}

/* 5. Выпадающее меню профиля */
.frc-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 270px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 12px 30px -4px rgba(15, 23, 42, 0.15), 0 4px 8px -2px rgba(15, 23, 42, 0.06);
    padding: 12px;
    z-index: 10000;
    animation: frcPopIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes frcPopIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.frc-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 4px 10px;
}

.frc-dropdown-avatar img {
    border-radius: 50%;
    display: block;
    border: 2px solid #e2e8f0;
}

.frc-dropdown-user-info {
    overflow: hidden;
    flex: 1;
}

.frc-dd-name {
    font-weight: 700;
    color: #0f172a;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.frc-dd-email {
    font-size: 11.5px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.frc-role-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.frc-badge-reader {
    background: #e0f2fe;
    color: #0369a1;
}

.frc-badge-admin {
    background: #fef3c7;
    color: #b45309;
}

.frc-dropdown-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 4px 0 8px;
}

.frc-dropdown-links {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.frc-dropdown-links li {
    margin: 0 0 2px 0 !important;
}

.frc-dd-item {
    display: flex !important;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: #334155 !important;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
    box-sizing: border-box;
}

.frc-dd-item:hover {
    background: #f8fafc;
    color: #0284c7 !important;
}

.frc-dd-item svg {
    flex-shrink: 0;
    color: #64748b;
}

.frc-dd-item:hover svg {
    color: #0284c7;
}

.frc-dd-logout:hover {
    color: #dc2626 !important;
    background: #fef2f2;
}
.frc-dd-logout:hover svg {
    color: #dc2626;
}

/* 6. Затемнение модального окна */
.frc-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99998;
    animation: frcFadeIn 0.2s ease;
}

@keyframes frcFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 7. Карточка модального окна */
.frc-modal-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    padding: 28px 26px;
    z-index: 99999;
    box-sizing: border-box;
    animation: frcModalOpen 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes frcModalOpen {
    from {
        opacity: 0;
        transform: translate(-50%, -46%) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.frc-modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.frc-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.frc-modal-badge {
    display: inline-block;
    padding: 3px 9px;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.frc-modal-title {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px 0 !important;
}

.frc-modal-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 18px 0 !important;
    line-height: 1.4;
}

/* 8. Кнопки соцсетей */
.frc-social-login-group {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 18px;
}

.frc-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 13px 20px;
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.18s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.frc-social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.14);
    opacity: 0.96;
}

.frc-social-vk {
    background: #0077ff;
    color: #ffffff !important;
}

.frc-social-vk:hover {
    background: #0066dd;
}

.frc-social-yandex {
    background: #fc3f1d;
    color: #ffffff !important;
}

.frc-social-yandex:hover {
    background: #e63212;
}

.frc-ya-badge {
    background: #ffffff;
    color: #fc3f1d;
    font-weight: 900;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
}

/* Примечание о безопасности входа */
.frc-social-note {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(2, 132, 199, 0.08);
    border: 1px solid rgba(2, 132, 199, 0.2);
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.4;
    color: #0369a1;
    margin-top: 14px;
    text-align: left;
}

.frc-social-note svg {
    flex-shrink: 0;
    color: #0284c7;
}

/* Разделитель */
.frc-auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #94a3b8;
    font-size: 11.5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 14px 0 16px;
}

.frc-auth-divider::before,
.frc-auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e2e8f0;
}

.frc-auth-divider span {
    padding: 0 10px;
}

/* 9. Поля ввода формы */
.frc-form-row {
    margin-bottom: 13px;
}

.frc-form-row label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}

.frc-input {
    width: 100% !important;
    padding: 9px 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    font-size: 13.5px !important;
    box-sizing: border-box !important;
    background: #f8fafc !important;
    color: #0f172a !important;
    transition: all 0.2s ease;
}

.frc-input:focus {
    background: #ffffff !important;
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
    outline: none !important;
}

.frc-form-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    margin-bottom: 16px;
}

.frc-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #475569;
    cursor: pointer;
}

.frc-lost-link {
    color: #0284c7 !important;
    text-decoration: none !important;
    font-weight: 500;
}

.frc-lost-link:hover {
    text-decoration: underline !important;
}

.frc-submit-btn {
    width: 100%;
    padding: 11px 18px;
    background: #0284c7;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.frc-submit-btn:hover {
    background: #0369a1;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.35);
}

.frc-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* 10. Сообщения об успехе/ошибке */
.frc-feedback-success {
    padding: 10px 14px;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

.frc-feedback-error {
    padding: 10px 14px;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

/* Блокировка прокрутки фона при открытом модальном окне */
body.frc-modal-open {
    overflow: hidden;
}

