.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: color .18s;
    margin-bottom: 4px;
}

.auth-back:hover { color: var(--accent); }

/* ── Auth Shell ── */
.auth-shell {
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-shell-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -.5px;
    padding: 24px 0 0;
    text-decoration: none;
}

.auth-shell-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    width: 100%;
}

/* ── Auth Card ── */
.auth-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 4px;
}

.auth-logo-img { height: 32px; }

.auth-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: -8px 0 0;
}

/* ── Fields ── */
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrap > i {
    position: absolute;
    left: 12px;
    font-size: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrap input {
    width: 100%;
    padding: 10px 40px 10px 38px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg);
    outline: none;
    transition: border-color .18s;
}

.input-wrap input:focus {
    border-color: var(--accent);
    background: var(--bg-white);
}

.input-eye {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 16px;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color .18s;
}

.input-eye:hover { color: var(--accent); }

/* ── Button ── */
.auth-btn {
    width: 100%;
    padding: 11px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .18s, opacity .18s;
    margin-top: 4px;
}

.auth-btn:hover { background: var(--accent-hover); }
.auth-btn:disabled { opacity: .6; cursor: not-allowed; }

.auth-btn-danger {
    background: #d32f2f;
}
.auth-btn-danger:hover { background: #b71c1c; }

/* ── Spinner ── */
.auth-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}

/* ── Messages ── */
.auth-error {
    background: #fdecea;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #c62828;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-success {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #2e7d32;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* ── Links ── */
.auth-links {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.auth-links a {
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    transition: opacity .18s;
}

.auth-links a:hover { opacity: .75; }

/* ── Header profile button ── */
.header-profile-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px 6px 10px;
    border-radius: 20px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background .18s;
}

.header-profile-btn i { font-size: 20px; }
.header-profile-btn:hover { background: #d2e3fc; }

.header-avatar-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.profile-avatar-delete {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    background: none;
    border: 1.5px solid #e53935;
    color: #e53935;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.profile-avatar-delete:hover { background: #fdecea; }
.profile-avatar-delete:disabled { opacity: .5; cursor: not-allowed; }

.header-profile-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Profile page ── */
.profile-wrap {
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.profile-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 20px;
    box-shadow: var(--shadow);
}

.profile-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 72px;
    height: 72px;
}

.profile-avatar i {
    font-size: 64px;
    color: var(--accent);
}

.profile-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-email {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 2px 0 8px;
}

.profile-role {
    background: var(--accent-light);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
}

.profile-section {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.profile-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ── Валидация email ── */
.field-error {
    font-size: 12px;
    color: #c62828;
    margin-top: 2px;
}

.input-invalid input {
    border-color: #e53935 !important;
    background: #fff5f5;
}

/* ── Кнопка удаления ── */
.auth-btn-delete {
    background: transparent;
    border: 1.5px solid #e53935;
    color: #e53935;
}
.auth-btn-delete:hover { background: #fdecea; }

/* ── Кнопка загрузки аватара при регистрации ── */
.reg-avatar-upload {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 7px 14px;
    border: 1.5px dashed var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color .18s, color .18s;
}
.reg-avatar-upload:hover { border-color: var(--accent); color: var(--accent); }

/* ── Кнопка загрузки аватара в профиле ── */
.profile-avatar-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    transition: opacity .18s;
}
.profile-avatar-upload-btn:hover { opacity: .75; }

/* ── Аватар профиля ── */
.profile-avatar-label {
    position: relative;
    display: inline-block;
    cursor: pointer;
    border-radius: 50%;
    overflow: hidden;
    line-height: 0;
}

.profile-avatar-label i.bi-person-circle {
    font-size: 64px;
    display: block;
    line-height: 1;
}

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

.profile-avatar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
}

.profile-avatar-label:hover .profile-avatar-overlay { opacity: 1; }

/* ── Палитра цветов ── */
.avatar-color-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.avatar-color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    transition: transform var(--transition), border-color var(--transition);
}

.avatar-color-swatch:hover { transform: scale(1.15); }
.avatar-color-swatch.selected { border-color: var(--text-primary); transform: scale(1.1); }

.avatar-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.avatar-preview i { font-size: 36px; }

/* ── Страница после удаления ── */
.profile-deleted {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 80px 20px;
    text-align: center;
}

.profile-deleted i {
    font-size: 64px;
    color: #e53935;
}

.profile-deleted h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-deleted p {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 360px;
}

/* ── Модальное окно ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn .15s ease;
}

.modal-box {
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    padding: 36px 32px;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    animation: slideDown .18s ease;
}

.modal-icon i {
    font-size: 48px;
    color: #e53935;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.modal-actions {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-top: 8px;
}

.modal-btn-cancel {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s;
}
.modal-btn-cancel:hover { background: var(--bg); }

.modal-btn-confirm {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: #e53935;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background .18s;
}
.modal-btn-confirm:hover { background: #c62828; }
.modal-btn-confirm:disabled { opacity: .6; cursor: not-allowed; }
