/* assets/css/style.css */

* {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

body {
    background: #f0f2f5;
    margin: 0;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

/* ===== НАВИГАЦИЯ ===== */
.nav-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
    background: white;
    padding: 12px 20px;
    border-radius: 60px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.nav-btn {
    background: transparent;
    border: none;
    padding: 10px 24px;
    border-radius: 60px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    color: #475569;
    text-decoration: none;
    display: inline-block;
}

.nav-btn:hover {
    background: #e2e8f0;
    transform: scale(0.98);
}

.nav-btn.active {
    background: #3b82f6;
    color: white;
}

.nav-btn.active:hover {
    background: #2563eb;
}

.nav-right {
    margin-left: auto;
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav-auth-link {
    color: #475569;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
    padding: 4px 0;
    cursor: pointer;
    background: none;
    border: none;
}

.nav-auth-link:hover {
    color: #3b82f6;
}

.nav-auth-link.register {
    color: #f59e0b;
}

.nav-auth-link.register:hover {
    color: #d97706;
}

.nav-auth-divider {
    color: #cbd5e1;
    font-weight: 300;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: #1e293b;
    flex-wrap: wrap;
}

.nav-user .user-city {
    color: #64748b;
    font-weight: 400;
}

.nav-user .user-email {
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    transition: color 0.2s;
}

.nav-user .user-email:hover {
    color: #3b82f6;
}

.nav-user .user-email.admin {
    color: #ef4444;
}

.nav-user .user-email.admin:hover {
    color: #dc2626;
}

.nav-user .user-email.clickable {
    cursor: pointer;
}

.nav-user .user-email.clickable:hover {
    color: #3b82f6;
    text-decoration: underline;
}

.nav-user .user-logout {
    color: #ef4444;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: 8px;
}

.nav-user .user-logout:hover {
    color: #dc2626;
    background: #fee2e2;
}

.nav-user .user-divider {
    color: #cbd5e1;
}

.nav-user .admin-badge {
    font-size: 0.65rem;
    background: #fee2e2;
    color: #991b1b;
    padding: 2px 10px;
    border-radius: 40px;
    font-weight: 600;
}

.nav-user .admin-badge.production {
    background: #dbeafe;
    color: #1e40af;
}

.nav-user .admin-badge.manager {
    background: #d1fae5;
    color: #065f46;
}

.nav-user .admin-badge.installer {
    background: #fef3c7;
    color: #92400e;
}

/* ===== КАРТОЧКИ ===== */
.card {
    background: white;
    border-radius: 32px;
    box-shadow: 0 20px 35px -12px rgba(0,0,0,0.15);
    padding: 2.5rem 3rem;
    margin-bottom: 24px;
}

.card h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.card .subtitle {
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 1rem;
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.3);
    padding: 32px 40px;
}

.modal-close {
    position: sticky;
    top: 12px;
    right: 12px;
    float: right;
    background: #1e293b;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
    cursor: pointer;
    transition: 0.2s;
    z-index: 10;
    margin: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.modal-close:hover {
    background: #ef4444;
    transform: rotate(90deg);
}

.modal-header {
    text-align: center;
    margin-bottom: 28px;
}

.modal-header .icon {
    font-size: 3rem;
    margin-bottom: 8px;
}

.modal-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e293b;
}

.modal-header p {
    color: #64748b;
    font-size: 0.9rem;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== ФОРМЫ ===== */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
    margin-bottom: 6px;
}

.form-group label .required {
    color: #ef4444;
    margin-left: 4px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-size: 1rem;
    transition: all 0.2s;
    background: #f8fafc;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-group .field-error {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 4px;
    display: none;
}

.form-group .field-error.show {
    display: block;
}

.form-group .field-error .error-icon {
    margin-right: 4px;
}

.form-group.error input {
    border-color: #ef4444;
    background: #fef2f2;
}

.role-hint {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 4px;
}

.btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(102, 126, 234, 0.4);
}

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-weight: 500;
    display: none;
}

.alert.show {
    display: block;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.footer-links {
    text-align: center;
    margin-top: 16px;
    font-size: 0.85rem;
    color: #94a3b8;
}

.footer-links a {
    color: #667eea;
    text-decoration: none;
    cursor: pointer;
}

.footer-links a:hover {
    text-decoration: underline;
}

.password-strength .bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 4px;
    margin-top: 4px;
    overflow: hidden;
}

.password-strength .bar .fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s, background 0.3s;
    border-radius: 4px;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 768px) {
    .card { padding: 1.8rem 1.5rem; }
    .card h1 { font-size: 1.8rem; }
    .nav-bar { border-radius: 20px; padding: 10px 16px; }
    .nav-btn { padding: 8px 16px; font-size: 0.85rem; }
    .nav-auth-link { font-size: 0.85rem; }
    .nav-user { font-size: 0.8rem; }
    .modal-content { padding: 24px 20px; }
}

@media (max-width: 480px) {
    .nav-right { 
        margin-left: 0; 
        width: 100%; 
        justify-content: center; 
        flex-wrap: wrap; 
    }
    .nav-user { justify-content: center; }
}