/* ==============================================
   Primo File Library — Auth (Login/Register) Styles
   ============================================== */

.pfl-auth {
    --pfl-auth-primary: #F4782B;
    --pfl-auth-primary-hover: #DC6619;
    --pfl-auth-primary-light: #FFF4ED;
    --pfl-auth-bg: #FFFFFF;
    --pfl-auth-bg-alt: #FAFBFC;
    --pfl-auth-text: #0F172A;
    --pfl-auth-text-2: #475569;
    --pfl-auth-text-3: #94A3B8;
    --pfl-auth-border: #E2E8F0;
    --pfl-auth-border-light: #F1F5F9;
    --pfl-auth-danger: #EF4444;
    --pfl-auth-success: #10B981;
    --pfl-auth-radius: 10px;
    --pfl-auth-radius-lg: 14px;
    --pfl-auth-radius-full: 9999px;
    --pfl-auth-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --pfl-auth-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    --pfl-auth-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --pfl-auth-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --pfl-auth-transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);

    font-family: var(--pfl-auth-font);
    color: var(--pfl-auth-text);
    max-width: 520px;
    margin: 0 auto;
    background: var(--pfl-auth-bg);
    border: 1px solid var(--pfl-auth-border);
    border-radius: var(--pfl-auth-radius-lg);
    box-shadow: var(--pfl-auth-shadow);
    overflow: hidden;
}

.pfl-auth *,
.pfl-auth *::before,
.pfl-auth *::after { box-sizing: border-box; }

/* SVG ICON FIX */
.pfl-auth svg path,
.pfl-auth svg rect,
.pfl-auth svg circle,
.pfl-auth svg polygon,
.pfl-auth svg polyline,
.pfl-auth svg line,
.pfl-auth svg ellipse {
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}
.pfl-auth svg [fill="currentColor"] {
    fill: currentColor !important;
    stroke: none !important;
}

/* Tabs */
.pfl-auth-tabs {
    display: flex;
    background: var(--pfl-auth-bg-alt);
    border-bottom: 1px solid var(--pfl-auth-border);
}
.pfl-auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 16px;
    font-family: var(--pfl-auth-font);
    font-size: 14px;
    font-weight: 600;
    color: var(--pfl-auth-text-2);
    cursor: pointer;
    transition: all var(--pfl-auth-transition);
    border-bottom: 2px solid transparent;
}
.pfl-auth-tab:hover {
    color: var(--pfl-auth-text);
    background: rgba(244, 120, 43, 0.04);
}
.pfl-auth-tab.active {
    color: var(--pfl-auth-primary);
    background: var(--pfl-auth-bg);
    border-bottom-color: var(--pfl-auth-primary);
}

/* Sections */
.pfl-auth-section { display: none; padding: 28px; }
.pfl-auth-section.active { display: block; animation: pfl-fade-in 200ms ease; }
@keyframes pfl-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Info banner */
.pfl-auth-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--pfl-auth-primary-light);
    color: var(--pfl-auth-primary);
    border-radius: var(--pfl-auth-radius);
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid rgba(244, 120, 43, 0.15);
}
.pfl-auth-info svg { flex-shrink: 0; }

/* Fields */
.pfl-auth-field {
    margin-bottom: 16px;
}
.pfl-auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--pfl-auth-text-2);
    margin-bottom: 6px;
}
.pfl-auth-required { color: var(--pfl-auth-danger); }

.pfl-auth-field input[type="text"],
.pfl-auth-field input[type="email"],
.pfl-auth-field input[type="password"] {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--pfl-auth-border);
    border-radius: var(--pfl-auth-radius);
    font-family: var(--pfl-auth-font);
    font-size: 14px;
    color: #1E293B;
    background: var(--pfl-auth-bg);
    transition: all var(--pfl-auth-transition);
    outline: none;
}
.pfl-auth-field input:focus {
    border-color: var(--pfl-auth-primary);
    box-shadow: 0 0 0 3px var(--pfl-auth-primary-light);
}

/* AUTOFILL FIX — Chrome/Edge заливают поля жёлтым/чёрным при автозаполнении */
.pfl-auth-field input:-webkit-autofill,
.pfl-auth-field input:-webkit-autofill:hover,
.pfl-auth-field input:-webkit-autofill:focus,
.pfl-auth-field input:-webkit-autofill:active {
    -webkit-text-fill-color: #1E293B !important;
    -webkit-box-shadow: 0 0 0 1000px #FFFFFF inset !important;
    caret-color: #1E293B;
    transition: background-color 5000s ease-in-out 0s;
}
.pfl-auth-field input:autofill {
    background: #FFFFFF !important;
    color: #1E293B !important;
}

.pfl-auth-password-wrap {
    position: relative;
}
.pfl-auth-toggle-pwd {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--pfl-auth-text-3);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--pfl-auth-transition);
}
.pfl-auth-toggle-pwd:hover {
    color: var(--pfl-auth-primary);
    background: var(--pfl-auth-primary-light);
}

.pfl-auth-hint {
    display: block;
    font-size: 12px;
    color: var(--pfl-auth-text-3);
    margin-top: 4px;
}

/* Generate login button */
.pfl-auth-login-wrap {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.pfl-auth-login-wrap input[type="text"] {
    flex: 1;
    min-width: 0;
}
.pfl-auth-generate-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    background: var(--pfl-auth-bg);
    color: var(--pfl-auth-primary);
    border: 1.5px solid var(--pfl-auth-primary);
    border-radius: var(--pfl-auth-radius);
    font-family: var(--pfl-auth-font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--pfl-auth-transition);
    white-space: nowrap;
    min-height: 44px;
}
.pfl-auth-generate-btn:hover {
    background: var(--pfl-auth-primary);
    color: #fff;
}
.pfl-auth-generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.pfl-auth-generate-btn .pfl-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(244, 120, 43, 0.3);
    border-top-color: var(--pfl-auth-primary);
    border-radius: 50%;
    animation: pfl-spin 0.7s linear infinite;
}
.pfl-auth-generate-btn:hover .pfl-spinner {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
}

/* Row: remember + lost password */
.pfl-auth-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 8px;
}
.pfl-auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--pfl-auth-text-2);
    cursor: pointer;
    user-select: none;
}
.pfl-auth-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--pfl-auth-primary);
}
.pfl-auth-link {
    font-size: 13px;
    color: var(--pfl-auth-primary);
    text-decoration: none;
    font-weight: 500;
}
.pfl-auth-link:hover {
    color: var(--pfl-auth-primary-hover);
    text-decoration: underline;
}

/* Submit button */
.pfl-auth-submit {
    width: 100%;
    padding: 13px;
    background: var(--pfl-auth-primary);
    color: #fff;
    border: none;
    border-radius: var(--pfl-auth-radius);
    font-family: var(--pfl-auth-font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--pfl-auth-transition);
    box-shadow: 0 4px 14px rgba(244, 120, 43, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.pfl-auth-submit:hover {
    background: var(--pfl-auth-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(244, 120, 43, 0.35);
}
.pfl-auth-submit:active {
    transform: translateY(0);
}
.pfl-auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Spinner внутри кнопки */
.pfl-auth-submit .pfl-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pfl-spin 0.7s linear infinite;
}
@keyframes pfl-spin { to { transform: rotate(360deg); } }

/* Error message */
.pfl-auth-error {
    padding: 12px 14px;
    background: #FEF2F2;
    color: var(--pfl-auth-danger);
    border-radius: var(--pfl-auth-radius);
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid #FEE2E2;
    display: none;
}
.pfl-auth-error.visible { display: block; }

/* ==============================================
   LOGGED-IN VIEW
   ============================================== */
.pfl-auth-logged-in {
    --pfl-auth-primary: #F4782B;
    --pfl-auth-primary-hover: #DC6619;
    --pfl-auth-primary-light: #FFF4ED;
    --pfl-auth-bg: #FFFFFF;
    --pfl-auth-bg-alt: #FAFBFC;
    --pfl-auth-text: #0F172A;
    --pfl-auth-text-2: #475569;
    --pfl-auth-text-3: #94A3B8;
    --pfl-auth-border: #E2E8F0;
    --pfl-auth-border-light: #F1F5F9;
    --pfl-auth-radius: 10px;
    --pfl-auth-radius-lg: 14px;
    --pfl-auth-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    --pfl-auth-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --pfl-auth-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --pfl-auth-font-display: 'Manrope', 'Inter', sans-serif;
    --pfl-auth-transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);

    font-family: var(--pfl-auth-font);
    color: var(--pfl-auth-text);
    max-width: 880px;
    margin: 0 auto;
    background: var(--pfl-auth-bg);
    border: 1px solid var(--pfl-auth-border);
    border-radius: var(--pfl-auth-radius-lg);
    box-shadow: var(--pfl-auth-shadow);
    overflow: hidden;
}
.pfl-auth-logged-in *,
.pfl-auth-logged-in *::before,
.pfl-auth-logged-in *::after { box-sizing: border-box; }

/* SVG fix для logged-in */
.pfl-auth-logged-in svg path,
.pfl-auth-logged-in svg rect,
.pfl-auth-logged-in svg circle,
.pfl-auth-logged-in svg polygon,
.pfl-auth-logged-in svg polyline,
.pfl-auth-logged-in svg line,
.pfl-auth-logged-in svg ellipse {
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}

.pfl-auth-user-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: linear-gradient(135deg, var(--pfl-auth-primary-light) 0%, var(--pfl-auth-bg) 100%);
    border-bottom: 1px solid var(--pfl-auth-border);
}
.pfl-auth-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(244, 120, 43, 0.2);
    flex-shrink: 0;
}
.pfl-auth-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pfl-auth-primary);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
}
.pfl-auth-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.pfl-auth-greeting {
    font-size: 13px;
    color: var(--pfl-auth-text-2);
}
.pfl-auth-name {
    font-size: 16px;
    color: var(--pfl-auth-text);
    word-break: break-word;
}
.pfl-auth-email {
    font-size: 12px;
    color: var(--pfl-auth-text-3);
    word-break: break-all;
}

.pfl-auth-actions {
    display: flex;
    gap: 8px;
    padding: 16px 24px;
}
.pfl-auth-action-link {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--pfl-auth-bg);
    color: var(--pfl-auth-text-2);
    border: 1px solid var(--pfl-auth-border);
    border-radius: var(--pfl-auth-radius);
    font-family: var(--pfl-auth-font);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--pfl-auth-transition);
}
.pfl-auth-action-link:hover {
    background: var(--pfl-auth-primary-light);
    color: var(--pfl-auth-primary);
    border-color: var(--pfl-auth-primary);
}
.pfl-auth-logout-btn:hover,
.pfl-auth-logout-link:hover {
    background: #FEF2F2;
    color: var(--pfl-auth-danger);
    border-color: var(--pfl-auth-danger);
}

/* Выделение кнопки «Цифровой банк ДО» — основная CTA */
.pfl-auth-library-link {
    background: var(--pfl-auth-primary) !important;
    color: #fff !important;
    border-color: var(--pfl-auth-primary) !important;
}
.pfl-auth-library-link:hover {
    background: var(--pfl-auth-primary-hover) !important;
    color: #fff !important;
    border-color: var(--pfl-auth-primary-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(244, 120, 43, 0.30);
}

/* Кнопка «Информация» — нейтральная, но с акцентом */
.pfl-auth-profile-btn {
    background: var(--pfl-auth-bg);
    color: var(--pfl-auth-text-2);
    border: 1px solid var(--pfl-auth-border);
    cursor: pointer;
    font-family: var(--pfl-auth-font);
}
.pfl-auth-profile-btn:hover {
    background: var(--pfl-auth-primary-light);
    color: var(--pfl-auth-primary);
    border-color: var(--pfl-auth-primary);
}

/* ==============================================
   PROFILE PAGE (v2.7.3)
   ==============================================
   Отдельная страница редактирования профиля —
   шорткод [file_library_profile]. Ранее (v2.7.2) это была
   модалка внутри [file_library_auth], но пользователь попросил
   сделать именно отдельную страницу. */

.pfl-profile-page {
    --pfl-profile-primary: #F4782B;
    --pfl-profile-primary-hover: #DC6619;
    --pfl-profile-primary-light: #FFF4ED;
    --pfl-profile-bg: #FFFFFF;
    --pfl-profile-text: #0F172A;
    --pfl-profile-text-2: #475569;
    --pfl-profile-text-3: #94A3B8;
    --pfl-profile-border: #E2E8F0;
    --pfl-profile-border-light: #F1F5F9;
    --pfl-profile-radius: 10px;
    --pfl-profile-radius-lg: 14px;
    --pfl-profile-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --pfl-profile-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    --pfl-profile-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --pfl-profile-font-display: 'Manrope', 'Inter', sans-serif;
    --pfl-profile-transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);

    font-family: var(--pfl-profile-font);
    color: var(--pfl-profile-text);
    max-width: 640px;
    margin: 0 auto;
    padding: 24px 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.pfl-profile-page *,
.pfl-profile-page *::before,
.pfl-profile-page *::after { box-sizing: border-box; }

/* SVG fix */
.pfl-profile-page svg path,
.pfl-profile-page svg rect,
.pfl-profile-page svg circle,
.pfl-profile-page svg polygon,
.pfl-profile-page svg polyline,
.pfl-profile-page svg line,
.pfl-profile-page svg ellipse {
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}

/* --- Шапка страницы: кнопка «Назад» + блок пользователя --- */
.pfl-profile-page-header {
    margin-bottom: 24px;
}
.pfl-profile-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--pfl-profile-primary);
    font-family: var(--pfl-profile-font);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 20px;
    transition: color var(--pfl-profile-transition);
}
.pfl-profile-back-link:hover {
    color: var(--pfl-profile-primary-hover);
    text-decoration: underline;
}

.pfl-profile-page-user {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--pfl-profile-primary-light) 0%, var(--pfl-profile-bg) 100%);
    border: 1px solid var(--pfl-profile-border);
    border-radius: var(--pfl-profile-radius-lg);
    box-shadow: var(--pfl-profile-shadow-sm);
}
.pfl-profile-page-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(244, 120, 43, 0.25);
    flex-shrink: 0;
}
.pfl-profile-page-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pfl-profile-primary);
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    font-family: var(--pfl-profile-font-display);
}
.pfl-profile-page-user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.pfl-profile-page-title {
    font-family: var(--pfl-profile-font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--pfl-profile-text);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
    word-break: break-word;
}
.pfl-profile-page-email {
    font-size: 14px;
    color: var(--pfl-profile-text-3);
    word-break: break-all;
}

/* --- Карточка с формой --- */
.pfl-profile-card {
    background: var(--pfl-profile-bg);
    border: 1px solid var(--pfl-profile-border);
    border-radius: var(--pfl-profile-radius-lg);
    box-shadow: var(--pfl-profile-shadow);
    overflow: hidden;
}
.pfl-profile-card-header {
    padding: 24px 28px 16px;
    border-bottom: 1px solid var(--pfl-profile-border-light);
}
.pfl-profile-card-header h2 {
    font-family: var(--pfl-profile-font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--pfl-profile-text);
    margin: 0 0 6px;
    letter-spacing: -0.015em;
}
.pfl-profile-card-header p {
    font-size: 14px;
    color: var(--pfl-profile-text-2);
    margin: 0;
    line-height: 1.5;
}

.pfl-profile-form {
    padding: 24px 28px 28px;
}

.pfl-profile-field {
    margin-bottom: 16px;
}
.pfl-profile-field:last-of-type {
    margin-bottom: 0;
}
.pfl-profile-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #0F172A;
    margin-bottom: 6px;
}
.pfl-profile-field input[type="text"],
.pfl-profile-field input[type="email"],
.pfl-profile-field input[type="password"],
.pfl-profile-field select,
.pfl-profile-field textarea {
    display: block;
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: #0F172A;
    background: #FFFFFF;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
    box-sizing: border-box;
}
.pfl-profile-field textarea {
    height: auto;
    padding: 10px 14px;
    resize: vertical;
    min-height: 88px;
    line-height: 1.5;
}
.pfl-profile-field input:focus,
.pfl-profile-field select:focus,
.pfl-profile-field textarea:focus {
    border-color: #F4782B;
    box-shadow: 0 0 0 3px rgba(244, 120, 43, 0.10);
}
.pfl-profile-field input:disabled {
    background: #F8FAFC;
    color: #64748B;
    cursor: not-allowed;
}
.pfl-profile-field select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}
.pfl-profile-hint {
    display: block;
    font-size: 12px;
    color: #94A3B8;
    margin-top: 4px;
    line-height: 1.4;
}
.pfl-required {
    color: #EF4444;
    margin-left: 2px;
}

/* Раскрывающийся блок смены пароля */
.pfl-profile-password-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #F1F5F9;
}
.pfl-profile-password-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: #F4782B;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: color 150ms ease;
}
.pfl-profile-password-toggle:hover {
    color: #DC6619;
    text-decoration: underline;
}
.pfl-profile-password-toggle svg {
    transition: transform 200ms ease;
}
.pfl-profile-password-toggle.pfl-expanded svg {
    transform: rotate(90deg);
}
.pfl-profile-password-fields {
    margin-top: 14px;
    padding: 16px;
    background: #F8FAFC;
    border: 1px solid #F1F5F9;
    border-radius: 10px;
}
.pfl-profile-password-fields .pfl-profile-field {
    margin-bottom: 12px;
}
.pfl-profile-password-fields .pfl-profile-field:last-child {
    margin-bottom: 0;
}

/* Сообщение об успехе/ошибке */
.pfl-profile-message {
    display: none;
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}
.pfl-profile-message-error {
    display: block;
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FECACA;
}
.pfl-profile-message-success {
    display: block;
    background: #ECFDF5;
    color: #059669;
    border: 1px solid #A7F3D0;
}

/* Кнопки в форме */
.pfl-profile-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #F1F5F9;
}
.pfl-profile-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 180ms;
    border: 1px solid transparent;
}
.pfl-profile-btn-cancel {
    background: #FFFFFF;
    color: #475569;
    border-color: #E2E8F0;
}
.pfl-profile-btn-cancel:hover {
    background: #F8FAFC;
    color: #0F172A;
    border-color: #CBD5E1;
}
.pfl-profile-btn-save {
    background: #F4782B;
    color: #fff;
    box-shadow: 0 4px 14px rgba(244, 120, 43, 0.30);
}
.pfl-profile-btn-save:hover {
    background: #DC6619;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(244, 120, 43, 0.40);
}
.pfl-profile-btn-save:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Адаптивность страницы профиля на маленьких экранах */
@media (max-width: 480px) {
    .pfl-profile-page {
        padding: 16px 0;
    }
    .pfl-profile-page-user {
        padding: 16px;
        gap: 12px;
    }
    .pfl-profile-page-avatar,
    .pfl-profile-page-avatar-placeholder {
        width: 56px;
        height: 56px;
    }
    .pfl-profile-page-avatar-placeholder {
        font-size: 22px;
    }
    .pfl-profile-page-title {
        font-size: 20px;
    }
    .pfl-profile-card-header {
        padding: 20px 16px 12px;
    }
    .pfl-profile-card-header h2 {
        font-size: 18px;
    }
    .pfl-profile-card-header p {
        font-size: 13px;
    }
    .pfl-profile-form {
        padding: 16px;
    }
    .pfl-profile-actions {
        flex-direction: column-reverse;
        gap: 8px;
    }
}

/* ==============================================
   USER HISTORY (v2.7.5)
   Секции «Недавно просмотренные» и «Скачанные материалы»
   в личном кабинете [file_library_auth].
   ============================================== */
.pfl-history-section {
    padding: 20px 24px;
    border-top: 1px solid var(--pfl-auth-border-light);
}
.pfl-history-section:first-of-type {
    border-top: none;
}

.pfl-history-title {
    font-family: var(--pfl-auth-font-display, var(--pfl-auth-font));
    font-size: 14px;
    font-weight: 700;
    color: var(--pfl-auth-text);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.pfl-history-title svg {
    color: var(--pfl-auth-primary);
}

.pfl-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.pfl-history-card {
    display: flex;
    flex-direction: column;
    background: var(--pfl-auth-bg);
    border: 1px solid var(--pfl-auth-border);
    border-radius: var(--pfl-auth-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all var(--pfl-auth-transition);
}
.pfl-history-card:hover {
    border-color: var(--pfl-auth-primary);
    box-shadow: 0 4px 12px rgba(244, 120, 43, 0.10);
    transform: translateY(-2px);
}

.pfl-history-card-thumb {
    height: 80px;
    background: var(--pfl-auth-bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding: 8px;
}
.pfl-history-card-thumb img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.pfl-history-card-type-badge {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--pfl-auth-bg-alt);
    color: var(--pfl-auth-text-3);
}
.pfl-history-type-pdf    { background: #FEE2E2; color: #B91C1C; }
.pfl-history-type-doc    { background: #DBEAFE; color: #1D4ED8; }
.pfl-history-type-xls    { background: #D1FAE5; color: #047857; }
.pfl-history-type-ppt    { background: #FEF3C7; color: #B45309; }
.pfl-history-type-video  { background: #EDE9FE; color: #6D28D9; }
.pfl-history-type-image  { background: #FCE7F3; color: #BE185D; }
.pfl-history-type-other  { background: #F1F5F9; color: #475569; }

.pfl-history-card-body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 70px;
}
.pfl-history-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--pfl-auth-text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--pfl-auth-transition);
}
.pfl-history-card:hover .pfl-history-card-title {
    color: var(--pfl-auth-primary);
}
.pfl-history-card-author {
    font-size: 11px;
    color: var(--pfl-auth-text-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pfl-history-card-date {
    font-size: 11px;
    color: var(--pfl-auth-text-3);
    margin-top: auto;
    font-variant-numeric: tabular-nums;
}

/* Адаптивность истории */
@media (max-width: 600px) {
    .pfl-history-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    .pfl-history-card-thumb {
        height: 64px;
        padding: 6px;
    }
    .pfl-history-card-title {
        font-size: 12px;
    }
}
@media (max-width: 400px) {
    .pfl-history-grid {
        grid-template-columns: 1fr 1fr;
    }
    .pfl-history-section {
        padding: 16px;
    }
}

/* ==============================================
   DOWNLOAD LOCK (инлайн-баннер на странице документа)
   ============================================== */
.pfl-download-locked {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #FFF4ED 0%, #FFFFFF 100%);
    border: 1px solid rgba(244, 120, 43, 0.2);
    border-left: 4px solid #F4782B;
    border-radius: 10px;
    margin-bottom: 10px;
}
.pfl-download-locked-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #F4782B;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pfl-download-locked-text {
    flex: 1;
    min-width: 0;
}
.pfl-download-locked-title {
    font-size: 14px;
    font-weight: 700;
    color: #0F172A;
    margin: 0 0 2px;
}
.pfl-download-locked-desc {
    font-size: 13px;
    color: #475569;
    margin: 0;
}
.pfl-download-locked-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: #F4782B;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 180ms;
    white-space: nowrap;
}
.pfl-download-locked-btn:hover {
    background: #DC6619;
    color: #fff;
    transform: translateY(-1px);
}

/* Адаптивность */
@media (max-width: 480px) {
    .pfl-auth { max-width: 100%; }
    .pfl-auth-section { padding: 20px; }
    .pfl-auth-row { flex-direction: column; align-items: flex-start; }
    .pfl-auth-logged-in .pfl-auth-actions { flex-direction: column; }
    .pfl-download-locked { flex-direction: column; text-align: center; }
}
