/* ===== Account CSS - Личный кабинет клиента ===== */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #f59e0b;
    --dark: #1e293b;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --light: #f8fafc;
    --white: #ffffff;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --sidebar-width: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--dark);
    line-height: 1.6;
    background: var(--light);
}

a {
    text-decoration: none;
    color: var(--primary);
}

a:hover {
    color: var(--primary-dark);
}

/* ===== Auth Pages ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 50%, #3d7ab3 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Back to home button */
.back-to-home {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    z-index: 10;
}

.back-to-home:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-3px);
}

.back-to-home span {
    font-size: 18px;
}

.auth-page::before {
    content: '';
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    width: 600px;
    height: 600px;
    background: url('../images/logo3.png') no-repeat center center;
    background-size: contain;
    opacity: 0.1;
    pointer-events: none;
}

.auth-container {
    display: flex;
    gap: 40px;
    max-width: 900px;
    width: 100%;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    flex: 0 1 450px;
    max-width: 450px;
}

/* Широкая карточка для формы с большим количеством полей */
.auth-card.auth-card-wide {
    flex: 0 1 550px;
    max-width: 550px;
    padding: 32px 40px;
}

.auth-card-wide .auth-form {
    gap: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .auth-card.auth-card-wide {
        padding: 24px;
    }
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
    text-decoration: none;
}

.auth-logo img {
    height: 48px;
    width: auto;
}

.auth-logo .logo-icon {
    font-size: 32px;
}

.auth-logo .logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: var(--dark);
}

.auth-subtitle {
    color: var(--gray);
    text-align: center;
    margin-bottom: 24px;
    font-size: 14px;
}

/* Alert Messages */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: var(--success);
    border: 1px solid #bbf7d0;
}

.alert-warning {
    background: #fffbeb;
    color: var(--warning);
    border: 1px solid #fed7aa;
}

.alert-icon {
    font-size: 18px;
}

/* Form Styles */
.auth-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(--dark);
}

.form-group label .required {
    color: var(--danger);
}

.form-group .optional {
    color: var(--gray-light);
    font-weight: 400;
}

.form-hint {
    font-size: 12px;
    color: var(--gray-light);
    margin-top: 2px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    font-size: 16px;
    opacity: 0.7;
}

.input-with-icon input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-with-icon input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-with-icon input::placeholder {
    color: var(--gray-light);
}

.password-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
    opacity: 0.7;
}

.password-toggle:hover {
    opacity: 1;
}

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.forgot-link {
    color: var(--primary);
    font-size: 14px;
}

/* Password Strength */
.password-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.strength-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s, background 0.3s;
}

.strength-text {
    font-size: 12px;
    color: var(--gray);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-telegram {
    background: #0088cc;
    color: var(--white);
    border-color: #0088cc;
}

.btn-telegram:hover {
    background: #006699;
    border-color: #006699;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.telegram-icon {
    width: 20px;
    height: 20px;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    color: var(--gray);
    font-size: 14px;
}

/* Telegram Login Section */
.telegram-login {
    text-align: center;
}

.telegram-hint {
    font-size: 13px;
    color: var(--gray);
    margin-top: 8px;
}

/* Telegram Complete Form */
.telegram-complete-form {
    background: var(--light);
    padding: 24px;
    border-radius: 12px;
    margin-top: 16px;
}

.telegram-complete-form h3 {
    color: var(--dark);
    font-size: 18px;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--gray);
}

/* Benefits Sidebar */
.auth-benefits {
    color: var(--white);
    max-width: 300px;
    padding: 40px 0;
    order: 2;
}

.auth-card {
    order: 1;
}

.auth-benefits h3 {
    font-size: 20px;
    margin-bottom: 24px;
}

.auth-benefits ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-benefits li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
}

.benefit-icon {
    font-size: 24px;
}

/* ===== Dashboard Layout ===== */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    color: var(--white);
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 16px;
    margin: 10px;
    border-bottom: none;
    background: var(--white);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.sidebar-logo-img {
    width: 120px;
    height: auto;
}

.sidebar-logo .logo-icon {
    font-size: 28px;
}

.sidebar-logo .logo-text {
    font-size: 20px;
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin: 4px 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255,255,255,0.7);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    text-decoration: none;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: var(--white);
}

.nav-link.active {
    background: var(--primary);
    color: var(--white);
}

.nav-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.nav-text {
    font-size: 15px;
    font-weight: 500;
}

/* Notification Badge */
.notification-badge {
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-phone {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.8);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    min-height: 100vh;
}

/* Page Header */
.page-header {
    margin-bottom: 30px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--gray);
    font-size: 15px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--gray);
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title-icon {
    font-size: 20px;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}

/* Repair List */
.repair-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.repair-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--light);
    border-radius: var(--radius-sm);
    transition: transform 0.2s;
}

.repair-item:hover {
    transform: translateX(4px);
}

.repair-icon {
    font-size: 32px;
}

.repair-info {
    flex: 1;
}

.repair-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.repair-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--gray);
}

.repair-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.status-in_progress {
    background: #dbeafe;
    color: #1e40af;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-confirmed {
    background: #d1fae5;
    color: #065f46;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

/* Booking Card */
.booking-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.booking-card .booking-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.booking-card .booking-date {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.booking-card .booking-service {
    font-size: 16px;
    opacity: 0.9;
}

.booking-card .booking-car {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 12px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-text {
    font-size: 16px;
    margin-bottom: 16px;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 600;
    font-size: 13px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    font-size: 14px;
}

tr:hover {
    background: var(--light);
}

/* Document List */
.document-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.document-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--light);
    border-radius: var(--radius-sm);
}

.document-icon {
    font-size: 32px;
}

.document-info {
    flex: 1;
}

.document-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.document-meta {
    font-size: 13px;
    color: var(--gray);
}

.document-actions {
    display: flex;
    gap: 8px;
}

/* Car Cards */
.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.car-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.car-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.car-card:hover .car-actions {
    opacity: 1;
}

.car-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.car-action-btn {
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.car-action-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.car-action-btn.delete:hover {
    background: var(--danger);
    border-color: var(--danger);
}

.car-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.car-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.car-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    color: var(--gray);
}

.car-detail {
    display: flex;
    align-items: center;
    gap: 8px;
}

.car-repairs {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 14px;
}

/* Settings Form */
.settings-form {
    max-width: 500px;
}

.settings-section {
    margin-bottom: 32px;
}

.settings-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* Telegram Link Section */
.telegram-section {
    background: linear-gradient(135deg, #0088cc 0%, #006699 100%);
    color: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 24px;
}

.telegram-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.telegram-section p {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 16px;
}

.link-code {
    background: rgba(255,255,255,0.2);
    padding: 16px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 4px;
    margin-bottom: 12px;
}

.link-expires {
    font-size: 13px;
    opacity: 0.8;
    text-align: center;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 200;
    background: var(--dark);
    color: var(--white);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    font-size: 24px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
    }
    
    .auth-card {
        max-width: none;
        order: 1;
    }
    
    .auth-benefits {
        display: none;
        order: 2;
    }
    
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 80px 20px 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cars-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 24px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .repair-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .repair-status {
        margin-top: 8px;
    }
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, var(--light) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--dark);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}
