/**
 * Личный кабинет + Вход — V3
 * /new/assets/css/account.css
 */

/* === Общие === */
.account-page,
.login-page {
    font-family: var(--fb);
}

/* === Страница входа === */
.login-page {
    max-width: 400px;
    margin: 40px auto;
    padding: 0 20px;
}

.login-box {
    background: #fff;
    border-radius: var(--r4);
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    font-family: var(--fd);
    color: var(--c1);
    margin-bottom: 8px;
    text-align: center;
}

.login-subtitle {
    color: var(--n5);
    text-align: center;
    margin-bottom: 24px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--c1);
}

.form-group input {
    padding: 14px 16px;
    border: 1px solid var(--n2);
    border-radius: var(--r2);
    font-size: 16px;
    font-family: var(--fb);
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--g5);
}

.btn-submit {
    background: var(--g5);
    color: #fff;
    border: none;
    padding: 14px 24px;
    border-radius: var(--r2);
    font-size: 16px;
    font-weight: 500;
    font-family: var(--fb);
    cursor: pointer;
    transition: background 0.2s;
}

.btn-submit:hover {
    background: var(--g6);
}

.btn-submit:disabled {
    background: var(--n3);
    cursor: not-allowed;
}

.code-step {
    display: none;
}

.code-step.active {
    display: block;
}

.phone-step.hidden {
    display: none;
}

.message {
    padding: 12px 16px;
    border-radius: var(--r2);
    font-size: 14px;
    margin-bottom: 16px;
}

.message.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.message.error {
    background: #ffebee;
    color: #c62828;
}

.message.info {
    background: var(--g1);
    color: var(--g6);
}

.change-phone {
    text-align: center;
    margin-top: 12px;
}

.change-phone a {
    color: var(--g5);
    text-decoration: none;
    font-size: 14px;
}

.timer {
    text-align: center;
    color: var(--n5);
    font-size: 14px;
    margin-top: 12px;
}

.timer a {
    color: var(--g5);
    text-decoration: none;
    cursor: pointer;
}

.timer a.disabled {
    color: var(--n4);
    cursor: default;
}

/* Выбор метода */
.method-step {
    display: none;
}
.method-step.active {
    display: block;
}
.method-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--c1);
    text-align: center;
    margin-bottom: 16px;
}
.method-icons {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.method-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 96px;
    padding: 16px 8px;
    border: 2px solid var(--n2);
    border-radius: var(--r3);
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.method-btn:hover:not(:disabled) {
    border-color: var(--g5);
    background: var(--g0);
}
.method-btn:active:not(:disabled) {
    transform: scale(0.96);
}
.method-btn.preferred {
    border-color: var(--g5);
    background: var(--g1);
}
.method-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    position: relative;
}
.method-btn svg {
    width: 36px;
    height: 36px;
}
.method-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--c1);
}
.method-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff9800;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 8px;
    white-space: nowrap;
}
.other-method-link {
    text-align: center;
    margin-top: 12px;
}
.other-method-link a {
    color: var(--g5);
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
}


/* === Личный кабинет === */
.account-page {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.account-title {
    font-size: 28px;
    font-weight: 700;
    font-family: var(--fd);
    color: var(--c1);
}

.account-phone {
    color: var(--n5);
    font-size: 16px;
}

.logout-link {
    color: var(--err);
    text-decoration: none;
    font-size: 14px;
}

.logout-link:hover {
    text-decoration: underline;
}

.orders-section {
    margin-top: 24px;
}

/* Уведомления */
.notification-section {
    background: #fff;
    border-radius: var(--r3);
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}
.notification-section .section-title {
    font-size: 18px;
    margin-bottom: 16px;
}
.notif-channel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--n1);
}
.notif-channel:last-child {
    border-bottom: none;
}
.notif-channel-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.notif-channel-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--r2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.notif-channel-name {
    font-size: 15px;
    font-weight: 500;
}
.notif-channel-desc {
    font-size: 12px;
    color: var(--n4);
}
.notif-toggle {
    position: relative;
    width: 48px;
    height: 28px;
}
.notif-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.notif-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--n3);
    border-radius: 28px;
    transition: background 0.3s;
}
.notif-toggle-slider:before {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
}
.notif-toggle input:checked + .notif-toggle-slider {
    background: var(--g5);
}
.notif-toggle input:checked + .notif-toggle-slider:before {
    transform: translateX(20px);
}
.notif-warning {
    background: #fff3e0;
    color: #e65100;
    padding: 10px 14px;
    border-radius: var(--r2);
    font-size: 13px;
    margin-top: 12px;
    display: none;
}
.notif-warning.visible {
    display: block;
}
.notif-recommended {
    font-size: 11px;
    color: var(--g5);
    font-weight: 500;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    font-family: var(--fd);
    color: var(--c1);
    margin-bottom: 16px;
}

/* Фильтры по статусу */
.order-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}
.order-filters::-webkit-scrollbar {
    display: none;
}
.order-filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--n2);
    border-radius: 20px;
    background: #fff;
    font-size: 14px;
    font-family: var(--fb);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    color: var(--c1);
}
.order-filter-btn:hover {
    border-color: var(--g5);
    color: var(--g5);
}
.order-filter-btn.active {
    background: var(--g5);
    color: #fff;
    border-color: var(--g5);
}
.order-filter-btn .filter-count {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    font-size: 11px;
    margin-left: 6px;
    background: rgba(0,0,0,0.08);
    color: inherit;
}
.order-filter-btn.active .filter-count {
    background: rgba(255,255,255,0.3);
}

/* Кнопка "Показать ещё" */
.show-more-wrap {
    text-align: center;
    margin: 20px 0;
}
.btn-show-more {
    padding: 12px 32px;
    border: 1px solid var(--n2);
    border-radius: var(--r2);
    background: #fff;
    font-size: 15px;
    font-family: var(--fb);
    cursor: pointer;
    color: var(--g5);
    transition: all 0.2s;
}
.btn-show-more:hover {
    background: var(--g0);
    border-color: var(--g5);
}

.no-filtered-orders {
    text-align: center;
    padding: 40px 20px;
    color: var(--n4);
    font-size: 15px;
    display: none;
}

/* Карточка заказа */
.order-card {
    background: #fff;
    border-radius: var(--r3);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--n1);
}

.order-number {
    font-size: 18px;
    font-weight: 600;
    color: var(--c1);
}

.order-date {
    color: var(--n5);
    font-size: 14px;
    margin-top: 4px;
}

.order-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* Статусы — семантические цвета, не меняем */
.status-new {
    background: #e3f2fd;
    color: #1565c0;
}
.status-processing {
    background: #fff3e0;
    color: #ef6c00;
}
.status-ready {
    background: #e8f5e9;
    color: #2e7d32;
}
.status-completed {
    background: #f5f5f5;
    color: var(--n5);
}
.status-cancelled {
    background: #ffebee;
    color: #c62828;
}
.status-confirmed {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Кнопки действий */
.order-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--n1);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-cancel-order {
    background: none;
    border: 1px solid var(--err);
    color: var(--err);
    padding: 8px 20px;
    border-radius: var(--r2);
    cursor: pointer;
    font-size: 14px;
    font-family: var(--fb);
    transition: all 0.2s;
}
.btn-cancel-order:hover {
    background: var(--err);
    color: #fff;
}
.btn-cancel-order:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-reorder {
    background: none;
    border: 1px solid var(--g5);
    color: var(--g5);
    padding: 8px 20px;
    border-radius: var(--r2);
    cursor: pointer;
    font-size: 14px;
    font-family: var(--fb);
    transition: all 0.2s;
}
.btn-reorder:hover {
    background: var(--g5);
    color: #fff;
}
.btn-reorder:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-edit-order {
    padding: 6px 16px;
    background: #fff;
    border: 1px solid var(--g5);
    color: var(--g5);
    border-radius: var(--r2);
    cursor: pointer;
    font-size: 13px;
    font-family: var(--fb);
    transition: all 0.2s;
}
.btn-edit-order:hover {
    background: var(--g5);
    color: #fff;
}

.reservation-label {
    font-size: 12px;
    color: var(--n5);
    margin-left: 4px;
}

.order-store {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--n0);
    border-radius: var(--r2);
}

.order-store-icon {
    font-size: 20px;
}

.order-store-address {
    font-size: 14px;
}

.order-items {
    margin-bottom: 16px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--n1);
}

.order-item:last-child {
    border-bottom: none;
}

.order-item-name {
    flex: 1;
}

.order-item-qty {
    color: var(--n5);
    margin: 0 16px;
}

.order-item-sum {
    font-weight: 500;
    white-space: nowrap;
}

.order-total {
    display: flex;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--n1);
    font-weight: 600;
    font-size: 16px;
    color: var(--c1);
}

.order-reservations {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--n1);
}

.reservation-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--n5);
}

.reservation-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--n0);
    border-radius: var(--r1);
    margin-bottom: 6px;
    font-size: 13px;
}

.reservation-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.reservation-status.confirmed {
    background: #4caf50;
}

.reservation-status.pending {
    background: #ff9800;
}

.reservation-status.cancelled {
    background: #f44336;
}

.reservation-ready {
    color: var(--g6);
    margin-left: auto;
}

/* Пустое состояние */
.no-orders {
    text-align: center;
    padding: 60px 20px;
    color: var(--n5);
}

.no-orders-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.no-orders h3 {
    font-size: 20px;
    font-weight: 700;
    font-family: var(--fd);
    margin-bottom: 8px;
    color: var(--c1);
}

.no-orders a {
    display: inline-block;
    margin-top: 16px;
    padding: 12px 24px;
    background: var(--g5);
    color: #fff;
    text-decoration: none;
    border-radius: var(--r2);
    transition: background 0.2s;
}
.no-orders a:hover {
    background: var(--g6);
}

/* === Mobile === */
@media (max-width: 600px) {
    .account-page {
        margin: 20px auto;
    }
    .account-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    .account-title {
        font-size: 22px;
    }
    .order-header {
        flex-direction: column;
        gap: 8px;
    }
    .order-item {
        font-size: 14px;
    }
    .login-page {
        margin: 20px auto;
    }
    .login-box {
        padding: 24px 20px;
    }
}
