/* Базовые стили для личного кабинета */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Страница входа */
.container {
    max-width: 500px;
    margin: 40px auto;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.login-box .header {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.logo {
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
    border-radius: 8px;
}

.login-box h1 {
    font-size: 28px;
    margin-bottom: 5px;
}

.subtitle {
    opacity: 0.9;
    font-size: 16px;
}

.content {
    padding: 30px;
}

/* Алерты */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Информационный блок */
.info-box {
    background: #f3f4f6;
    border-left: 4px solid #7c3aed;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 25px;
}

.info-box p {
    margin-bottom: 10px;
}

.info-box ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.info-box li {
    margin-bottom: 8px;
}

.note {
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
    margin-bottom: 0 !important;
}

/* Формы */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #7c3aed;
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #7c3aed;
    color: white;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    background: #6d28d9;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-outline {
    background: white;
    color: #7c3aed;
    border: 2px solid #7c3aed;
}

.btn-outline:hover {
    background: #f3f4f6;
}

.footer-text {
    margin-top: 30px;
    text-align: center;
    font-size: 14px;
    color: #6b7280;
}

.footer-text p {
    margin-bottom: 5px;
}

.footer-text a {
    color: #7c3aed;
    text-decoration: none;
}

.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: white;
    text-decoration: none;
    font-size: 14px;
}

/* Dashboard */
.dashboard-container {
    min-height: 100vh;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: #333;
}

.logo-small {
    width: 60px;
    height: auto;
    border-radius: 6px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-email {
    font-size: 14px;
    color: #6b7280;
}

.dashboard-main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
}

.welcome-section {
    margin-bottom: 30px;
}

.welcome-section h2 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #111827;
}

/* Заказы */
.orders-grid {
    display: grid;
    gap: 20px;
}

.order-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f3f4f6;
}

.order-number {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    color: #111827;
}

.order-date {
    font-size: 13px;
    color: #6b7280;
    margin-top: 5px;
}

.order-amount {
    font-size: 24px;
    font-weight: bold;
    color: #7c3aed;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-paid { background: #d1fae5; color: #065f46; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-shipped { background: #dbeafe; color: #1e40af; }
.status-delivered { background: #e0e7ff; color: #3730a3; }

.order-details {
    margin: 20px 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
}

.detail-label {
    color: #6b7280;
    font-weight: 500;
}

.shipping-address {
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.shipping-address h4 {
    margin-bottom: 10px;
    color: #374151;
}

.shipping-address p {
    margin-bottom: 5px;
    font-size: 14px;
    color: #6b7280;
}

.order-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.btn-edit {
    flex: 1;
    text-align: center;
}

/* Loading & Error states */
.loading-state,
.error-state {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-state svg {
    color: #ef4444;
    margin-bottom: 20px;
}

/* Модальное окно */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #f3f4f6;
}

.modal-header h3 {
    font-size: 20px;
    color: #111827;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #9ca3af;
    padding: 0;
    width: 30px;
    height: 30px;
}

.modal-content form {
    padding: 25px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.modal-footer .btn {
    flex: 1;
}

.dashboard-footer {
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 20px;
    text-align: center;
    font-size: 14px;
    color: #6b7280;
}

.dashboard-footer a {
    color: #7c3aed;
    text-decoration: none;
}

/* Адаптивность */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .user-menu {
        width: 100%;
        justify-content: space-between;
    }

    .order-header {
        flex-direction: column;
        gap: 10px;
    }

    .modal-content {
        max-height: 85vh;
    }
}
