* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 40px 20px;
}
.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 50px 60px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
h1 {
    color: #667eea;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.2em;
    font-weight: 700;
}
.user-type-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #764ba2;
}
.user-type-prefix {
    font-weight: 700;
    font-size: 1.1em;
    color: #2d3748;
    margin-right: 10px;
}
.user-type-selector label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}
.user-type-selector input[type="radio"]:checked + label,
.user-type-selector label:has(input:checked) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}
.user-type-selector input[type="radio"] {
    display: none;
}
.form-section {
    margin-bottom: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}
.form-section h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.3em;
    border-bottom: 2px solid #cbd5e0;
    padding-bottom: 10px;
    margin-top: 0;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}
.form-row.full {
    grid-template-columns: 1fr;
}
.form-group {
    display: flex;
    flex-direction: column;
}
label {
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.95em;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="tel"], select {
    padding: 12px 16px;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
}
select {
    cursor: pointer;
    background-color: white;
}
input[type="text"]::placeholder {
    color: #a0aec0;
    font-style: italic;
}
input:focus, select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.custom-piece-input {
    display: none;
    margin-top: 8px;
}
.custom-piece-input.visible {
    display: block;
}
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}
.checkbox-group:hover {
    border-color: #667eea;
    transform: translateX(3px);
}
.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}
.checkbox-group label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95em;
    color: #2d3748;
}
button[type="submit"] {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}
button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(76, 175, 80, 0.5);
}
.back-link {
    text-align: center;
    margin-top: 20px;
}
.back-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}
.back-link a:hover {
    text-decoration: underline;
}
.password-match-error {
    color: #dc2626;
    font-size: 0.85em;
    margin-top: 4px;
    display: none;
}
.password-match-success {
    color: #16a34a;
    font-size: 0.85em;
    margin-top: 4px;
    display: none;
}
.date-error {
    color: #dc2626;
    font-size: 0.85em;
    margin-top: 4px;
    display: none;
    font-weight: 500;
}
input.error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}
input.success {
    border-color: #16a34a;
}
@media (max-width: 1024px) {
    .container {
        max-width: 700px;
        padding: 40px;
    }
}
@media (max-width: 768px) {
    body {
        padding: 20px 10px;
    }
    .container {
        max-width: 100%;
        padding: 25px 18px;
    }
    h1 { font-size: 1.6em; }
    .form-row { grid-template-columns: 1fr; }
    .user-type-selector {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }
    .form-section {
        padding: 18px;
    }
}
@media (max-width: 480px) {
    body {
        padding: 10px 0;
    }
    .container {
        border-radius: 12px;
        padding: 18px 14px;
    }
    h1 { font-size: 1.35em; }
    .form-section {
        padding: 14px 12px;
        margin-bottom: 18px;
    }
    .form-section h3 {
        font-size: 1.1em;
    }
    .captcha-container {
        flex-wrap: wrap;
    }
    .captcha-image {
        min-width: 160px;
    }
}

/* ── Captcha ─────────────────────────────────────────── */
.captcha-section { background: #f8f9ff; border: 1px solid #dce0f0; }
.captcha-hint { font-size: 0.88em; color: #666; margin-bottom: 12px; }
.captcha-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.captcha-image {
    border: 2px solid #c8cce8;
    border-radius: 6px;
    background: #fff;
    min-width: 220px;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}
.captcha-image svg { display: block; border-radius: 4px; }
.captcha-refresh-btn {
    background: none;
    border: 1px solid #c8cce8;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 1.2em;
    cursor: pointer;
    color: #555;
    transition: background 0.15s;
    flex-shrink: 0;
}
.captcha-refresh-btn:hover { background: #eef0ff; }
#captcha_answer { max-width: 160px; letter-spacing: 0.15em; text-transform: uppercase; font-size: 1.1em; }
