:root {
            --primary: #2563eb;
            --dark: #0f172a;
            --surface: #ffffff;
            --text: #1e293b;
            --muted: #64748b;
            --border: #e2e8f0;
            --bg: #f1f5f9;
        }

        * { box-sizing: border-box; margin: 0; padding: 0; }
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            color: var(--text);
            background-color: var(--bg);
            line-height: 1.6;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        .container {
            width: 100%;
            max-width: 500px;
        }

        h1 { text-align: center; margin-bottom: 16px; color: var(--dark); }
        p.subtitle { text-align: center; color: var(--muted); margin-bottom: 32px; max-width: 450px; margin-left: auto; margin-right: auto; }

        /* --- СТИЛИЗАЦИЯ РАДИО-КНОПОК (КАРТОЧКИ) --- */
        .role-radio { display: none; }

        .role-label {
            border: 2px solid var(--border);
            border-radius: 16px;
            padding: 30px 20px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            background: white;
            display: block;
        }

        .role-label:hover {
            transform: translateY(-4px);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
            border-color: var(--primary);
        }

        .role-radio:checked + .role-label {
            border-color: var(--primary);
            background-color: #eff6ff;
            box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
        }

        .icon-big { font-size: 2.5rem; margin-bottom: 16px; display: block; }
        .role-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 8px; color: var(--dark); }
        .role-desc { font-size: 0.85rem; color: var(--muted); }

        .role-selection {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 24px;
            margin-bottom: 40px;
        }

        @media (max-width: 480px) {
            .role-selection { grid-template-columns: 1fr; }
        }

        /* --- ФОРМА И ЕЕ СОСТОЯНИЯ --- */
        .section-block {
            background: var(--surface);
            padding: 24px;
            border-radius: 12px;
            border: 2px solid var(--border);
            margin-bottom: 24px;
            box-shadow: 0 1px 2px rgba(0,0,0,0.02);
        }
        
        /* СКРЫТОЕ СОСТОЯНИЕ */
        #registrationForm { 
            display: none; 
            opacity: 0;
            transform: translateY(20px);
            transition: opacity 0.4s ease, transform 0.4s ease;
        }

        /* ВИДИМОЕ СОСТОЯНИЕ */
        #registrationForm.visible {
            display: block; 
            opacity: 1;
            transform: translateY(0);
        }

        .form-group { margin-bottom: 20px; }
        label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--dark); }

        input[type="email"],
        input[type="password"] {
            width: 100%;
            padding: 12px 16px;
            border: 1px solid var(--border); 
            border-radius: 8px;
            font-size: 1rem;
            transition: border-color 0.2s, box-shadow 0.2s;
            background: #fff;
        }

        /* КЛАСС АКТИВНОЙ ПОДСВЕТКИ */
        .active-input input {
            border-color: var(--primary) !important;
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
            background: #f8fafc;
        }

        input:focus { outline: none; border-color: var(--primary); }

        button.submit-btn {
            width: 100%;
            padding: 14px;
            background-color: var(--primary);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.2s;
        }
        button.submit-btn:hover { background-color: #1d4ed8; }

        .login-link {
            margin-top: 24px;
            text-align: center;
            font-size: 0.9rem;
        }
        .login-link a { color: var(--primary); text-decoration: underline; }

        /* --- ПРОГРЕСС БАР --- */
        .progress-container {
            margin-bottom: 32px;
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .step-indicator {
            width: 36px; height: 36px;
            border-radius: 50%;
            background: var(--border);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            flex-shrink: 0;
        }
        .step-1 { background: var(--primary); }
        .step-text { color: var(--muted); font-size: 0.9rem; }

        /* --- АВАТАР --- */
        .avatar-upload-area {
            text-align: center;
            margin-bottom: 24px;
            cursor: pointer;
            border: 2px dashed var(--border);
            border-radius: 12px;
            padding: 20px;
            transition: all 0.3s;
        }
        .avatar-upload-area:hover { border-color: var(--primary); background: #f8fafc; }
        
        #avatarPreview {
            width: 100px; height: 100px;
            border-radius: 50%;
            object-fit: cover;
            margin: 0 auto 12px auto;
            border: 4px solid white;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            display: none;
        }
        
        #avatarInput { display: none; }
        .upload-text { font-weight: 500; color: var(--primary); cursor: pointer; }
        .upload-text:hover { text-decoration: underline; }

        /* --- ФОРМА --- */
        .form-group { margin-bottom: 20px; }
        label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--dark); }
        
        input[type="text"],
        textarea {
            width: 100%;
            padding: 12px 16px;
            border: 1px solid var(--border);
            border-radius: 8px;
            font-size: 1rem;
            transition: border-color 0.2s;
            resize: none; /* Отключаем растягивание textarea */
        }
        input:focus, textarea:focus {
            outline: none;
            border-color: var(--primary);
        }

        button.submit-btn {
            width: 100%;
            padding: 14px;
            background-color: var(--primary);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.2s;
        }
        button.submit-btn:hover { background-color: #1d4ed8; }

        .back-link {
            margin-top: 24px;
            text-align: center;
            font-size: 0.9rem;
            color: var(--muted);
        }
        .back-link a { color: var(--primary); text-decoration: underline; cursor: pointer; }

        .password-strength {
  height: 6px;
  width: 100%;
  background-color: #e0e0e0;
  border-radius: 3px;
  margin-top: 4px;
  overflow: hidden;
  position: relative;
}

.password-strength::after {
  content: '';
  display: block;
  height: 100%;
  width: 0%;
  background: transparent;
  transition: width 0.2s ease, background-color 0.2s ease;
}

/* Цвета шкалы: красный → оранжевый → жёлтый → зелёный */
.password-strength.weak::after       { background: #ff4d4d; width: 25%; }
.password-strength.medium::after     { background: #ffcc00; width: 50%; }
.password-strength.strong::after     { background: #4caf50; width: 75%; }
.password-strength.very-strong::after { background: #2e7d32; width: 100%; }
