/* ========== Личный кабинет — кнопка в шапке ========== */
.account-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--pink-light);
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: border-color 0.2s, background 0.2s;
    flex-shrink: 0;
    margin-left: 10px;
    position: relative;
}
.account-btn:hover { border-color: var(--pink); background: var(--pink-light); }
.account-btn.logged-in { border-color: var(--pink); background: var(--pink); color: #fff; }
.account-btn .account-dot {
    position: absolute;
    top: -2px; right: -2px;
    width: 10px; height: 10px;
    background: #4caf50;
    border-radius: 50%;
    border: 2px solid #fff;
    display: none;
}
.account-btn.logged-in .account-dot { display: block; }

/* ========== Модалка входа/регистрации ========== */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.auth-modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}
.auth-modal {
    background: #fff;
    border-radius: 24px;
    padding: 32px 28px 28px;
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    transform: translateY(20px);
    transition: transform 0.25s;
}
.auth-modal-overlay.open .auth-modal { transform: translateY(0); }
.auth-modal-close {
    position: absolute;
    top: 14px; right: 16px;
    background: none; border: none;
    font-size: 1.4rem; cursor: pointer;
    color: #aaa; line-height: 1;
}
.auth-modal-close:hover { color: var(--pink); }
.auth-modal h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--pink);
    margin-bottom: 6px;
}
.auth-modal-subtitle {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 20px;
}
.auth-tabs {
    display: flex;
    gap: 4px;
    background: var(--pink-light);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
}
.auth-tab {
    flex: 1;
    padding: 7px 6px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--muted);
    transition: background 0.2s, color 0.2s;
}
.auth-tab.active { background: #fff; color: var(--pink); }
.auth-step { display: none; }
.auth-step.active { display: block; }
.auth-field { margin-bottom: 14px; }
.auth-field label {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 5px;
    font-weight: 500;
}
.auth-field input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e0d0d8;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: #fafafa;
    transition: border-color 0.2s;
}
.auth-field input:focus { outline: none; border-color: var(--pink); background: #fff; }
.auth-submit {
    width: 100%;
    padding: 12px;
    background: var(--pink);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
    margin-top: 4px;
}
.auth-submit:hover { background: var(--pink-dark); }
.auth-submit:disabled { background: #ccc; cursor: not-allowed; }
.auth-message {
    font-size: 0.85rem;
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    display: none;
}
.auth-message.error   { background: #fdecea; color: #c62828; display: block; }
.auth-message.success { background: #d4edda; color: #155724; display: block; }
.auth-link {
    font-size: 0.82rem;
    color: var(--pink);
    cursor: pointer;
    text-decoration: underline;
    background: none;
    border: none;
    font-family: inherit;
}
.auth-footer { text-align: center; margin-top: 14px; font-size: 0.82rem; color: var(--muted); }
.auth-dev-code {
    display: inline-block;
    background: #fff3cd; color: #856404;
    font-family: monospace; font-size: 1.4rem; font-weight: 700;
    padding: 4px 14px; border-radius: 8px; letter-spacing: 4px;
    margin: 8px 0;
}

/* ========== Личный кабинет — страница ========== */
.account-page {
    padding: 0 0 5rem;
    max-width: 720px;
    margin: 0 auto;
}

/* Шапка — hero-баннер с градиентом */
.account-hero {
    background: linear-gradient(135deg, var(--pink) 0%, #c2185b 100%);
    border-radius: 0 0 32px 32px;
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.account-hero::before {
    content: '';
    position: absolute;
    top: -50px; right: -50px;
    width: 180px; height: 180px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.account-hero::after {
    content: '';
    position: absolute;
    bottom: -30px; left: -30px;
    width: 120px; height: 120px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}
.account-avatar {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin: 0 auto 12px;
    border: 3px solid rgba(255,255,255,0.5);
    position: relative;
    z-index: 1;
}
.account-hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 3px;
    position: relative;
    z-index: 1;
}
.account-hero-phone {
    font-size: 0.9rem;
    opacity: 0.85;
    margin-bottom: 1.2rem;
    position: relative;
    z-index: 1;
}

/* Статистика в шапке */
.account-stats {
    display: flex;
    justify-content: center;
    gap: 0;
    background: rgba(255,255,255,0.15);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    max-width: 340px;
    margin: 0 auto;
}
.account-stat {
    flex: 1;
    padding: 10px 8px;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,0.2);
}
.account-stat:last-child { border-right: none; }
.account-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 3px;
}
.account-stat-label {
    font-size: 0.72rem;
    opacity: 0.8;
}

/* Кнопка выйти в шапке */
.account-logout-top {
    position: absolute;
    top: 16px; right: 16px;
    background: rgba(255,255,255,0.15);
    border: 1.5px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    z-index: 2;
    transition: background 0.2s;
}
.account-logout-top:hover { background: rgba(255,255,255,0.25); }

/* Табы */
.account-tabs {
    display: flex;
    gap: 3px;
    background: var(--pink-light);
    border-radius: 14px;
    padding: 4px;
    margin: 0 1rem 1.5rem;
}
.account-tab {
    flex: 1;
    padding: 10px 8px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--muted);
    font-family: inherit;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    text-align: center;
}
.account-tab.active { background: #fff; color: var(--pink); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.account-tab-content { display: none; padding: 0 1rem; }
.account-tab-content.active { display: block; animation: fadeInUp 0.3s ease; }

/* Карточки заказов */
.order-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
}
.order-card:hover {
    box-shadow: 0 6px 24px rgba(233,30,99,0.1);
    transform: translateY(-2px);
}
.order-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.order-card-name { font-weight: 700; font-size: 1rem; }
.order-card-status {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--pink-light);
    color: var(--pink);
}
.order-card-meta { font-size: 0.82rem; color: var(--muted); }
.order-card-items { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }

/* Пустые состояния */
.account-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
}
.account-empty-icon { font-size: 3rem; margin-bottom: 12px; }
.account-empty p { font-size: 0.92rem; line-height: 1.5; }

/* Адреса */
.addr-card {
    background: #fff;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

/* Организации в ЛК */
.acc-company-card {
    background: #fff;
    border: 1.5px solid #e8dce8;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 10px;
}
.acc-company-card.is-default { border-color: var(--pink-light); background: #fff8fb; }
.acc-company-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.acc-company-name { font-weight: 700; font-size: 0.95rem; color: var(--text); margin-bottom: 3px; }
.acc-company-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 2px; }
.acc-company-default { font-size: 0.75rem; color: var(--pink); font-weight: 700; margin-top: 4px; }
.acc-company-actions { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; flex-shrink: 0; }
.acc-company-btn {
    background: none; border: 1px solid #e0d0d8; border-radius: 8px;
    padding: 5px 12px; font-family: inherit; font-size: 0.78rem; font-weight: 600;
    color: var(--muted); cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.acc-company-btn:hover { border-color: var(--pink); color: var(--pink); background: #fff0f5; }
.acc-company-btn.danger:hover { border-color: #e53935; color: #e53935; background: #fff5f5; }
.acc-company-add-btn {
    width: 100%; padding: 12px; border: 1.5px dashed #d0c0cc; border-radius: 12px;
    background: transparent; color: var(--muted); font-family: 'Raleway', sans-serif;
    font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: all 0.2s; margin-top: 4px;
}
.acc-company-add-btn:hover { border-color: var(--pink); color: var(--pink); background: #fff0f5; }
.acc-company-form {
    background: #fff8fb; border: 1.5px solid #f0d8e8; border-radius: 14px;
    padding: 18px 16px; margin-top: 12px;
}

/* Подписанты в ЛК */
.acc-sigs-section { margin-top: 12px; padding-top: 10px; border-top: 1px solid #f0e0ec; }
.acc-sigs-title { font-size: 0.75rem; font-weight: 700; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px; }
.acc-sigs-empty { font-size: 0.82rem; color: var(--muted); margin-bottom: 8px; }
.acc-sig-item { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid #f5edf2; }
.acc-sig-item:last-of-type { border-bottom: none; }
.acc-sig-info { flex: 1; display: flex; flex-wrap: wrap; gap: 0 10px; }
.acc-sig-fio  { font-weight: 600; font-size: 0.88rem; color: var(--text); }
.acc-sig-pos  { font-size: 0.78rem; color: var(--muted); }
.acc-sig-email { font-size: 0.78rem; color: var(--muted); width: 100%; }
.acc-sig-btns { display: flex; gap: 4px; flex-shrink: 0; }
.acc-sig-add-btn {
    background: none; border: 1px dashed #d0c0cc; border-radius: 8px;
    padding: 5px 12px; font-family: inherit; font-size: 0.8rem; font-weight: 600;
    color: var(--muted); cursor: pointer; transition: all 0.2s; margin-top: 8px;
}
.acc-sig-add-btn:hover { border-color: var(--pink); color: var(--pink); }
.addr-card-label { font-weight: 600; font-size: 0.88rem; margin-bottom: 2px; }
.addr-card-value { font-size: 0.84rem; color: var(--muted); }
.addr-del-btn {
    background: none;
    border: none;
    color: #e53935;
    cursor: pointer;
    font-size: 1.1rem;
    flex-shrink: 0;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.15s;
}
.addr-del-btn:hover { background: #fdecea; }

/* Форма добавления адреса */
.addr-add-form {
    background: #fff;
    border-radius: 16px;
    padding: 16px 18px;
    margin-top: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.addr-add-form h4 { font-size: 0.95rem; margin-bottom: 10px; color: var(--pink); }
.addr-add-form .addr-inputs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.addr-add-form input {
    padding: 9px 12px;
    border: 1.5px solid #e0d0d8;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.88rem;
    transition: border-color 0.2s;
}
.addr-add-form input:focus { outline: none; border-color: var(--pink); }
.addr-add-form .addr-btn {
    padding: 9px 18px;
    background: var(--pink);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.88rem;
}

@media (max-width: 600px) {
    .account-hero { padding: 2rem 1rem 1.5rem; border-radius: 0 0 24px 24px; }
    .account-hero h1 { font-size: 1.2rem; }
    .account-tab { font-size: 0.75rem; padding: 8px 6px; }
    .account-tab-content { padding: 0 0.5rem; }
    .account-tabs { margin: 0 0.5rem 1.2rem; }
}

/* Баннер активации кабинета — после успешного заказа */
.account-offer-banner {
    background: linear-gradient(135deg, #fff 0%, #fff8fb 100%);
    border: 2px solid var(--pink-light);
    border-radius: 18px;
    padding: 18px 20px;
    margin-top: 22px;
    text-align: left;
    position: relative;
    overflow: hidden;
}
.account-offer-banner::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 120px; height: 120px;
    background: var(--pink);
    opacity: 0.06;
    border-radius: 50%;
}
.account-offer-banner .banner-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.account-offer-banner .banner-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    background: var(--pink-light);
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.account-offer-banner .banner-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    color: var(--text);
    margin-bottom: 3px;
    line-height: 1.25;
}
.account-offer-banner .banner-subtitle {
    font-size: 0.84rem;
    color: var(--muted);
    line-height: 1.45;
}
.account-offer-banner .banner-perks {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 12px 0 14px;
    padding: 12px 14px;
    background: rgba(233,30,99,0.04);
    border-radius: 12px;
}
.account-offer-banner .perk {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.4;
}
.account-offer-banner .perk-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}
.account-offer-banner .perk strong { color: var(--pink-dark); font-weight: 600; }
.account-offer-banner .banner-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.account-offer-banner .banner-btn {
    padding: 11px 22px;
    background: var(--pink);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(233,30,99,0.25);
    transition: transform 0.15s, box-shadow 0.2s;
}
.account-offer-banner .banner-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(233,30,99,0.35);
    background: var(--pink-dark);
}
.account-offer-banner .banner-skip {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
    text-decoration: underline;
    padding: 4px 8px;
}
.account-offer-banner .banner-skip:hover { color: var(--pink); }
.account-offer-banner .banner-note {
    font-size: 0.75rem;
    color: #999;
    margin-top: 8px;
    font-style: italic;
}
@media (max-width: 480px) {
    .account-offer-banner { padding: 16px 16px; }
    .account-offer-banner .banner-title { font-size: 1.05rem; }
    .account-offer-banner .banner-btn { width: 100%; }
}

/* Кнопка ❤ на товарах */
.product-wishlist-btn {
    position: absolute;
    top: 8px; right: 8px;
    width: 28px; height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.8);
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s, opacity 0.2s;
    z-index: 1;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    opacity: 0;
    backdrop-filter: blur(2px);
}
.product-card:hover .product-wishlist-btn { opacity: 0.85; }
.product-wishlist-btn:hover { transform: scale(1.15); background: #fff; opacity: 1 !important; }
.product-wishlist-btn.in-wishlist { opacity: 1 !important; color: #e91e63; background: #fff; }
@keyframes wishlistPop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.45); }
    70%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}
.product-wishlist-btn.pop { animation: wishlistPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }

@media (max-width: 768px) {
    .auth-modal { padding: 24px 18px 20px; }
    .account-tabs { gap: 2px; }
    .account-tab { padding: 8px 10px; font-size: 0.8rem; }
    .account-btn { margin-left: 6px; width: 34px; height: 34px; }
}

/* Бонусные баллы в шапке */
.account-bonus {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 50px;
    padding: 5px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: 10px;
    position: relative;
    z-index: 1;
    cursor: help;
}
.account-bonus-icon { font-size: 1rem; }

/* Карточка действия в профиле */
.profile-card {
    background: #fff;
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.profile-card h4 {
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.profile-card h4 .card-icon { font-size: 1.1rem; }

/* Переключатель подписки */
.toggle-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
}
.toggle-switch-label { font-size: 0.88rem; color: var(--text); line-height: 1.4; flex: 1; }
.toggle-switch-sub { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.toggle-track {
    width: 46px; height: 26px;
    background: #ddd;
    border-radius: 50px;
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s;
    cursor: pointer;
}
.toggle-track.on { background: var(--pink); }
.toggle-thumb {
    position: absolute;
    top: 3px; left: 3px;
    width: 20px; height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: left 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle-track.on .toggle-thumb { left: 23px; }

/* Форма смены пароля */
.password-form { display: none; margin-top: 12px; }
.password-form.open { display: block; }
/* pf-* классы используются как в password-form, так и в профиле напрямую */
.pf-field { margin-bottom: 10px; }
.pf-field input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e0d0d8;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
.pf-field input:focus { outline: none; border-color: var(--pink); }
.pf-btn {
    background: var(--pink);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 9px 22px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}
.pf-btn:hover { background: var(--pink-dark); }
.pf-msg { font-size: 0.82rem; margin-top: 8px; min-height: 18px; }

/* Кнопка «Заказать снова» на карточке заказа */
.order-card-reorder {
    background: var(--pink-light);
    color: var(--pink);
    border: none;
    border-radius: 50px;
    padding: 5px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
    margin-top: 8px;
}
.order-card-reorder:hover { background: #f8bbd0; }
