/* Custom Registration Form Styles */
/* Custom Registration Form Styles - Beautiful Design */
.custom-registration-container {
    max-width: 480px;
    margin: 40px auto;
    padding: 0;
    background: linear-gradient(135deg, #37514c 0%, #2a3d37 100%);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(55, 81, 76, 0.3), 0 10px 20px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
    position: relative;
}

.custom-registration-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ece2cc 0%, #f5f0e0 50%, #ece2cc 100%);
}

.custom-registration-form {
    width: 100%;
    padding: 40px 30px 30px;
    background: white;
    margin: 0;
    border-radius: 0 0 20px 20px;
    position: relative;
}

.registration-title {
    text-align: center;
    color: #37514c;
    margin: -20px 0 40px;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1px;
    position: relative;
    padding: 20px 0;
    background: linear-gradient(135deg, #37514c 0%, #2a3d37 100%);
    margin-left: -30px;
    margin-right: -30px;
    margin-top: -40px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.registration-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: #ece2cc;
    border-radius: 2px;
}

/* Form Groups - Enhanced Design */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 10px;
    color: #37514c;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.3px;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e8e0d0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(145deg, #ffffff 0%, #fafafa 100%);
    color: #333;
    box-sizing: border-box;
    position: relative;
    box-shadow: 0 2px 8px rgba(55, 81, 76, 0.08);
}

.form-input:focus {
    outline: none;
    border-color: #37514c;
    box-shadow: 0 0 0 4px rgba(55, 81, 76, 0.15), 0 4px 12px rgba(55, 81, 76, 0.1);
    transform: translateY(-1px);
    background: white;
}

.form-input:hover {
    border-color: #37514c;
    box-shadow: 0 4px 12px rgba(55, 81, 76, 0.1);
}

.form-input::placeholder {
    color: #a0a0a0;
    opacity: 1;
    font-weight: 400;
}

/* Account Type Selection - Modern Toggle Design */
.account-type-group {
    margin-bottom: 36px;
    padding: 24px;
    background: linear-gradient(145deg, #f8f6f0 0%, #ece2cc 100%);
    border-radius: 16px;
    border: 1px solid rgba(55, 81, 76, 0.1);
}

.radio-group {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    background: white;
    padding: 6px;
    border-radius: 12px;
    box-shadow: inset 0 2px 8px rgba(55, 81, 76, 0.1);
}

.radio-label {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    color: #37514c;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    text-align: center;
    position: relative;
    letter-spacing: 0.3px;
}

.radio-label:hover {
    background: rgba(55, 81, 76, 0.05);
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    display: none;
}

.radio-label input[type="radio"]:checked + .radio-custom + span {
    color: white;
}

.radio-label:has(input[type="radio"]:checked) {
    background: linear-gradient(135deg, #37514c 0%, #2a3d37 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(55, 81, 76, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Company Fields - Elegant Slide-in Design */
.company-fields {
    margin-bottom: 24px;
    padding: 24px;
    background: linear-gradient(145deg, #f8f6f0 0%, #ece2cc 100%);
    border-radius: 16px;
    border: 2px solid rgba(55, 81, 76, 0.1);
    position: relative;
    overflow: hidden;
}

.company-fields::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #37514c 0%, #2a3d37 100%);
}

.company-fields .form-group {
    margin-bottom: 20px;
}

.company-fields .form-group:last-child {
    margin-bottom: 0;
}

.company-fields .form-input {
    background: white;
    border-color: rgba(55, 81, 76, 0.2);
}

/* Checkbox Group - Modern Design */
.checkbox-group {
    margin-bottom: 32px;
    padding: 20px;
    background: linear-gradient(145deg, #fafafa 0%, #f0f0f0 100%);
    border-radius: 12px;
    border: 1px solid rgba(55, 81, 76, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    flex-wrap: nowrap;
    font-size: 14px;
    color: #37514c;
    margin-bottom: 16px;
    line-height: 1.6;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 8px;
}

.checkbox-label:hover {
    background: rgba(55, 81, 76, 0.05);
}

.checkbox-label:last-child {
    margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #d0c8b8;
    border-radius: 6px;
    margin-right: 14px;
    margin-top: 3px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(55, 81, 76, 0.1);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    border-color: #37514c;
    background: linear-gradient(135deg, #37514c 0%, #2a3d37 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(55, 81, 76, 0.2);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    color: white;
    font-size: 13px;
    font-weight: bold;
    animation: checkmark 0.3s ease;
}

@keyframes checkmark {
    0% { transform: translate(-50%, -50%) scale(0); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.checkbox-label a {
    color: #37514c;
    text-decoration: underline;
}

.checkbox-label a:hover {
    color: #2a3d39;
}

/* Submit Button - Premium Design */
.submit-button {
    width: 100%;
    padding: 18px 32px;
    background: linear-gradient(135deg, #37514c 0%, #2a3d37 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 20px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 24px rgba(55, 81, 76, 0.3), 0 4px 8px rgba(0, 0, 0, 0.1);
}

.submit-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.submit-button:hover {
    background: linear-gradient(135deg, #2a3d37 0%, #1f2e26 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(55, 81, 76, 0.4), 0 6px 12px rgba(0, 0, 0, 0.15);
}

.submit-button:hover::before {
    left: 100%;
}

.submit-button:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(55, 81, 76, 0.3);
}

.submit-button:disabled {
    background: linear-gradient(135deg, #ccc 0%, #999 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.submit-button:disabled::before {
    display: none;
}

/* Messages */
.registration-messages {
    margin-bottom: 20px;
    border-radius: 6px;
    padding: 15px;
    display: none;
}

.registration-messages.success {
    background-color: rgba(76, 175, 80, 0.1);
    border: 1px solid #4CAF50;
    color: #2E7D32;
    display: block;
}

.registration-messages.error {
    background-color: rgba(244, 67, 54, 0.1);
    border: 1px solid #F44336;
    color: #C62828;
    display: block;
}

/* Loading State */
.form-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #ece2cc;
    border-top: 3px solid #37514c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .custom-registration-container {
        margin: 10px;
        padding: 15px;
    }
    
    .registration-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-input {
        padding: 10px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .submit-button {
        padding: 12px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .custom-registration-container {
        margin: 5px;
        padding: 12px;
    }
    
    .registration-title {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .account-type-group,
    .company-fields {
        padding: 15px;
    }
    
    .checkbox-label {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .checkbox-custom {
        width: 16px;
        height: 16px;
        margin-right: 10px;
    }
}

/* Focus and Accessibility */
.form-input:focus,
.radio-label:focus-within,
.checkbox-label:focus-within,
.submit-button:focus {
    outline: 2px solid #37514c;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-input {
        border-width: 3px;
    }
    
    .radio-custom,
    .checkbox-custom {
        border-width: 3px;
    }
}

/* VAT Validation Messages - Enhanced */
.vat-validation-message {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    animation: slideInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@keyframes slideInUp {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.vat-success {
    background-color: rgba(76, 175, 80, 0.1);
    border: 1px solid #4CAF50;
    color: #2E7D32;
}

.vat-error {
    background-color: rgba(244, 67, 54, 0.1);
    border: 1px solid #F44336;
    color: #C62828;
}

.vat-warning {
    background-color: rgba(255, 152, 0, 0.1);
    border: 1px solid #FF9800;
    color: #E65100;
}

.vat-info {
    background-color: rgba(33, 150, 243, 0.1);
    border: 1px solid #2196F3;
    color: #1565C0;
    font-size: 12px;
    margin-top: 4px;
}

.vat-suggestion {
    background-color: rgba(156, 39, 176, 0.1);
    border: 1px solid #9C27B0;
    color: #7B1FA2;
    font-size: 12px;
    margin-top: 4px;
}

.vat-loading {
    background-color: rgba(158, 158, 158, 0.1);
    border: 1px solid #9E9E9E;
    color: #424242;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vat-loading::before {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid #9E9E9E;
    border-top: 2px solid #37514c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Enhanced error field styling */
.form-input.error-field {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.15) !important;
    background: linear-gradient(145deg, #fff5f5 0%, #ffffff 100%) !important;
    animation: shake 0.5s ease-in-out;
}

.form-input:focus.error-field {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.25) !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* VAT field specific styling */
#company_tax_id {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 500;
    background: linear-gradient(145deg, #f8f9fa 0%, #ffffff 100%);
}

#company_tax_id::placeholder {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: normal;
    text-transform: none;
    font-weight: 400;
}

#company_tax_id:focus {
    background: white;
    letter-spacing: 2px;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .custom-registration-container {
        margin: 20px 16px;
        max-width: none;
        border-radius: 16px;
    }
    
    .custom-registration-form {
        padding: 30px 20px 20px;
    }
    
    .registration-title {
        font-size: 28px;
        margin-left: -20px;
        margin-right: -20px;
        margin-top: -30px;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .radio-label {
        padding: 16px 20px;
        font-size: 16px;
    }
    
    .form-input {
        padding: 14px 16px;
        font-size: 16px;
    }
    
    .submit-button {
        padding: 16px 24px;
        font-size: 16px;
    }
    
    .account-type-group,
    .company-fields,
    .checkbox-group {
        padding: 20px 16px;
    }
}

@media (max-width: 480px) {
    .custom-registration-container {
        margin: 16px 12px;
        border-radius: 12px;
    }
    
    .custom-registration-form {
        padding: 24px 16px 16px;
    }
    
    .registration-title {
        font-size: 24px;
        margin-left: -16px;
        margin-right: -16px;
        margin-top: -24px;
    }
    
    .account-type-group,
    .company-fields,
    .checkbox-group {
        padding: 16px 12px;
    }
    
    .checkbox-label {
        font-size: 13px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .form-input,
    .radio-custom,
    .checkbox-custom,
    .submit-button,
    .company-fields {
        transition: none;
    }
    
    .form-loading::after,
    .vat-loading::before {
        animation: none;
    }
    
    .vat-validation-message {
        animation: none;
    }
    
    .checkbox-custom::after {
        animation: none;
    }
    
    .submit-button::before {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-input {
        border-width: 3px;
    }
    
    .radio-custom,
    .checkbox-custom {
        border-width: 3px;
    }
    
    .submit-button {
        border: 2px solid white;
    }
}

/* CAPTCHA Integration - All Types */
.recaptcha-container {
    margin: 24px 0;
    text-align: center;
    padding: 20px;
    background: linear-gradient(145deg, #f8f6f0 0%, #ece2cc 100%);
    border-radius: 12px;
    border: 1px solid rgba(55, 81, 76, 0.1);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* reCAPTCHA v2 */
.recaptcha-container .g-recaptcha {
    display: inline-block;
    margin: 0 auto;
    transform: scale(0.9);
    transform-origin: center;
}

/* reCAPTCHA v3 - Hidden input */
.recaptcha-container #g-recaptcha-response {
    display: none;
}

/* hCaptcha */
.recaptcha-container .h-captcha {
    display: inline-block;
    margin: 0 auto;
    transform: scale(0.9);
    transform-origin: center;
}

/* Cloudflare Turnstile */
.recaptcha-container .cf-turnstile {
    display: inline-block;
    margin: 0 auto;
    transform: scale(0.9);
    transform-origin: center;
}

/* CAPTCHA Loading State */
.recaptcha-container:empty::before {
    content: 'CAPTCHA wird geladen...';
    color: #666;
    font-size: 14px;
    font-style: italic;
}

/* CAPTCHA Error States */
.recaptcha-container.captcha-error {
    border-color: #e74c3c !important;
    background: linear-gradient(145deg, #fff5f5 0%, #ffe6e6 100%) !important;
    animation: shake 0.5s ease-in-out;
}

.captcha-config-error {
    padding: 15px !important;
    background: #fff3cd !important;
    border: 1px solid #ffeaa7 !important;
    border-radius: 8px !important;
    color: #856404 !important;
    text-align: center !important;
    font-size: 14px;
    line-height: 1.5;
}

.captcha-config-error strong {
    color: #d63384;
    font-weight: 600;
}

.captcha-config-error small {
    font-size: 12px;
    opacity: 0.8;
}

/* Address and Contact Sections */
.address-section,
.contact-section {
    margin: 32px 0;
    padding: 24px;
    background: linear-gradient(145deg, #fafafa 0%, #f0f0f0 100%);
    border-radius: 12px;
    border: 1px solid rgba(55, 81, 76, 0.1);
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #37514c;
    margin: 0 0 20px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #ece2cc;
    text-align: left;
}

/* Form Row Layout */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 0;
}

.form-group-half {
    flex: 1;
}

.form-group-large {
    flex: 2;
}

.form-group-small {
    flex: 0 0 80px;
}

/* Select Dropdown Styling */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2337514c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.form-select:focus {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
}

/* Mobile responsive CAPTCHA */
@media (max-width: 480px) {
    .recaptcha-container .g-recaptcha,
    .recaptcha-container .h-captcha,
    .recaptcha-container .cf-turnstile {
        transform: scale(0.8);
    }
    
    .recaptcha-container {
        padding: 16px 12px;
        min-height: 70px;
    }
    
    .captcha-config-error {
        padding: 12px !important;
        font-size: 13px;
    }
    
    /* Mobile responsive for new sections */
    .address-section,
    .contact-section {
        margin: 24px 0;
        padding: 16px;
    }
    
    .section-title {
        font-size: 15px;
        margin-bottom: 16px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-group-half,
    .form-group-large,
    .form-group-small {
        flex: none;
        width: 100%;
    }
    
    .form-select {
        background-position: right 8px center;
        background-size: 14px;
        padding-right: 32px;
    }
    
    /* Logged-in message responsive */
    .logged-in-message {
        padding: 30px 20px;
        border-radius: 16px;
    }
    
    .logged-in-message h2 {
        font-size: 24px;
        margin-bottom: 16px;
    }
    
    .logged-in-message p {
        font-size: 15px;
        margin-bottom: 16px;
    }
    
    .logged-in-message a {
        padding: 14px 20px;
        font-size: 15px;
        width: 100%;
        box-sizing: border-box;
    }
}

/* Logged-in User Message Section */
.logged-in-message {
    width: 100%;
    padding: 40px 30px;
    background: white;
    margin: 0;
    border-radius: 20px;
    position: relative;
    text-align: center;
    box-shadow: 0 20px 40px rgba(55, 81, 76, 0.3), 0 10px 20px rgba(0, 0, 0, 0.1);
}

.logged-in-message h2 {
    color: #37514c;
    margin: 0 0 20px 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logged-in-message p {
    color: #37514c;
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 20px 0;
    opacity: 0.8;
}

.logged-in-message a {
    color: #37514c;
    text-decoration: none;
    font-weight: 600;
    padding: 12px 24px;
    background: linear-gradient(135deg, #37514c 0%, #2a3d37 100%);
    color: white;
    border-radius: 8px;
    display: inline-block;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.logged-in-message a:hover {
    background: linear-gradient(135deg, #2a3d37 0%, #1f2e26 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(55, 81, 76, 0.3);
}

/* Checkbox Text Container */
.checkbox-text {
    display: block;
    line-height: 1.4;
    word-spacing: normal;
    flex: 1;
    margin-left: 8px;
}

/* Checkbox Link Styling - No underlines, no bold */
.checkbox-link {
    text-decoration: none !important;
    font-weight: normal !important;
    color: inherit;
    border-bottom: none !important;
    display: inline;
}

.checkbox-link:hover {
    text-decoration: none !important;
    color: inherit;
    opacity: 0.8;
}

.checkbox-link:visited {
    text-decoration: none !important;
    color: inherit;
}

.checkbox-link:focus {
    text-decoration: none !important;
    outline: 1px dotted currentColor;
    outline-offset: 2px;
}
