.registration-form-container {
    max-width: 1200px; /* Increased width by 1.5x (800 * 1.5 = 1200) */
    margin: 2rem auto;
    padding: 0 1rem;
}

.registration-form-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-width: 1200px; /* Match container width */
}

.registration-form-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.quick-start-promo__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    color: #1d4ed8;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.quick-start-promo__link:hover {
    color: #1e40af;
    background: #fff;
}

.registration-form-header h3 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 600;
}

.registration-form-body {
    padding: 2rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-row.single {
    justify-content: center;
}

.form-field {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.form-field.full-width {
    flex: 1 1 100%;
}

.form-field.half-width {
    flex: 1 1 50%;
}

.form-field.third-width {
    flex: 1 1 33.333%;
}

/* Ensure all input fields have consistent width */
.field-input-group {
    width: 100%;
    display: flex;
    align-items: stretch;
}

.field-input {
    width: 100%;
    box-sizing: border-box;
}

.field-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.required-asterisk {
    color: #dc3545;
    font-weight: bold;
    margin-left: 2px;
}

.field-input-group {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
}

.field-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-right: none;
    color: #6c757d;
    font-size: 1rem;
    min-width: 50px;
}

.field-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-left: none;
    border-radius: 0 8px 8px 0;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    height: 48px; /* Ensure consistent height for all input fields */
    box-sizing: border-box; /* Include padding and border in width calculation */
}

.field-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Validation feedback styles */
.field-input.is-valid {
    border-color: #28a745;
    background-color: #f8fff9;
}

.field-input.is-valid:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.field-input.is-invalid {
    border-color: #dc3545;
    background-color: #fff8f8;
}

.field-input.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.field-input-group:focus-within .field-icon.is-valid {
    border-color: #28a745;
    background: #e8f5e8;
    color: #28a745;
}

.field-input-group:focus-within .field-icon.is-invalid {
    border-color: #dc3545;
    background: #ffeaea;
    color: #dc3545;
}

.field-input-group:focus-within .field-icon {
    border-color: #007bff;
    background: #e3f2fd;
    color: #007bff;
}

.password-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    width: 100%;
}

.password-fields {
    flex: 1;
    display: flex;
    gap: 1rem;
    min-width: 0; /* Allow shrinking */
}

/* Ensure password fields are exactly the same size */
.password-fields .form-field {
    flex: 1 1 50%; /* Equal flex basis for both password fields */
    min-width: 0;
}

.show-password-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0;
    min-width: 150px; /* Reduced from 200px */
    max-width: 200px; /* Prevent overflow */
    flex-shrink: 0; /* Don't shrink */
    height: 60px; /* Increased height to better center with password fields */
    margin-top: 6px; /* Fine-tune vertical alignment */
}

.show-password-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: #555;
}

.show-password-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #007bff;
}

.captcha-section {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
}

.captcha-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.captcha-header {
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.captcha-image-container {
    text-align: center;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
}

.captcha-image {
    border: 2px solid #007bff;
    border-radius: 8px;
    max-width: 100%;
    width: 350px;
    height: 60px;
    object-fit: cover;
    box-sizing: border-box;
}

.captcha-loading {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    max-width: 100%;
    width: 350px;
    height: 60px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
    box-sizing: border-box;
}

.captcha-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-shrink: 0;
}

.captcha-input {
    flex: 1 1 200px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.captcha-button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.captcha-refresh {
    background: #007bff;
    color: white;
}

.captcha-refresh:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.captcha-audio {
    background: #28a745;
    color: white;
}

.captcha-audio:hover {
    background: #1e7e34;
    transform: translateY(-1px);
}

/* CAPTCHA input styling moved to captcha.css to avoid conflicts */

.captcha-hint {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #0d47a1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.captcha-hint i {
    color: #2196f3;
    font-size: 0.9rem;
}

.terms-section {
    margin: 2rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}

.terms-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #007bff;
    margin-top: 0.1rem;
}

.terms-text {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
}

.terms-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.terms-link:hover {
    color: #0056b3;
    text-decoration: none;
    border-bottom-color: #0056b3;
}

.terms-link:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
    border-radius: 2px;
}

.submit-section {
    margin-top: 2rem;
}

.submit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.submit-button {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    flex: 1;
    max-width: 300px;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.submit-button:active {
    transform: translateY(0);
}

.login-link {
    flex-shrink: 0;
}

.login-link a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.login-link a:hover {
    text-decoration: underline;
}

/* VALIDATION MESSAGES - OUTSIDE FORM ON RIGHT SIDE */
.validation-messages-container {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 350px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 900;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* When closed via JS (class added by closeValidationSummary) - higher specificity overrides above */
.validation-messages-container.validation-messages-container--hidden,
.validation-messages-container[style*="display: none"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.validation-summary {
    background: #fff5f5;
    border: 2px solid #dc3545;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(220, 53, 69, 0.3);
    overflow: hidden;
}

.validation-summary-header {
    background: #dc3545;
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 0.95rem;
}

.validation-summary-header i {
    margin-right: 8px;
}

.validation-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

/* Ensure the icon does not capture the click so the button's handler always runs */
.validation-close i {
    pointer-events: none;
}

.validation-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.validation-summary-body {
    padding: 16px;
}

.validation-summary-body ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.validation-summary-body li {
    color: #721c24;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 8px;
    padding-left: 16px;
    position: relative;
}

.validation-summary-body li:before {
    content: "â€¢";
    color: #dc3545;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.validation-summary-body li:last-child {
    margin-bottom: 0;
}

/* RESPONSIVE DESIGN */
@media (max-width: 1200px) {
    .registration-form-container {
        max-width: 100%;
        margin: 1rem;
        padding: 0 0.5rem;
    }
    
    .registration-form-card {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .registration-form-container {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }

    .registration-form-body {
        padding: 1.5rem;
    }

    .form-row {
        flex-direction: column;
        gap: 1rem;
    }

    .password-row {
        flex-direction: column;
        gap: 1rem;
    }

    .password-fields {
        flex-direction: column;
    }

    .show-password-container {
        min-width: auto;
        justify-content: flex-start;
    }

    .validation-messages-container {
        position: static;
        transform: none;
        width: 100%;
        margin-top: 1rem;
        max-height: none;
    }

    /* CAPTCHA: stack on tablet and below so nothing overflows */
    .captcha-row {
        flex-direction: column;
        align-items: stretch;
    }

    .captcha-image-container {
        width: 100%;
        max-width: 100%;
    }

    .captcha-image,
    .captcha-loading {
        width: 100%;
        max-width: 100%;
    }

    .captcha-controls {
        justify-content: center;
    }

    .captcha-input {
        width: 100%;
        max-width: 100%;
        flex: none;
        height: 52px;
        min-height: 52px;
        max-height: 52px;
        padding: 10px 12px;
        font-size: 16px;
    }

    .captcha-input::placeholder {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .registration-form-header {
        padding: 1.5rem;
    }

    .registration-form-header h3 {
        font-size: 1.5rem;
    }

    .registration-form-body {
        padding: 1rem;
    }

    .captcha-section {
        padding: 1rem;
        margin: 1rem 0;
    }

    .captcha-row {
        gap: 0.75rem;
    }

    .captcha-image-container {
        width: 100%;
        max-width: 100%;
    }

    .captcha-image,
    .captcha-loading {
        width: 100%;
        max-width: 100%;
        height: 56px;
        min-height: 56px;
    }

    .captcha-controls {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }

    .captcha-input {
        width: 100%;
        max-width: 100%;
        flex: none;
        height: 48px;
        min-height: 48px;
        max-height: 48px;
        padding: 8px 12px;
        font-size: 16px;
    }

    .captcha-input::placeholder {
        font-size: 12px;
    }

    .submit-row {
        flex-direction: column;
        gap: 1rem;
    }

    .submit-button {
        max-width: 100%;
    }
}

/* Dark mode: keep autofilled email/password fields consistent with other inputs */
@keyframes registrationWebkitAutofill {
    from {
        opacity: 1;
    }

    to {
        opacity: 1;
    }
}

@media (prefers-color-scheme: dark) {
    .registration-form-body .field-input:-webkit-autofill,
    .registration-form-body .field-input:-webkit-autofill:hover,
    .registration-form-body .field-input:-webkit-autofill:focus,
    .registration-form-body .field-input:-webkit-autofill:active,
    .registration-form-body .field-input:autofill,
    .registration-form-body .field-input:autofill:hover,
    .registration-form-body .field-input:autofill:focus,
    .registration-form-body .field-input:autofill:active {
        -webkit-text-fill-color: #f1f5f9 !important;
        caret-color: #f1f5f9 !important;
        border-color: #475569 !important;
        -webkit-box-shadow: 0 0 0 1000px #1e293b inset !important;
        box-shadow: 0 0 0 1000px #1e293b inset !important;
        transition: background-color 5000s ease-in-out 0s, color 5000s ease-in-out 0s;
        animation-name: registrationWebkitAutofill;
        animation-duration: 0.001s;
    }
}

html.color-scheme-dark .registration-form-body .field-input:-webkit-autofill,
html.color-scheme-dark .registration-form-body .field-input:-webkit-autofill:hover,
html.color-scheme-dark .registration-form-body .field-input:-webkit-autofill:focus,
html.color-scheme-dark .registration-form-body .field-input:-webkit-autofill:active,
html.color-scheme-dark .registration-form-body .field-input:autofill,
html.color-scheme-dark .registration-form-body .field-input:autofill:hover,
html.color-scheme-dark .registration-form-body .field-input:autofill:focus,
html.color-scheme-dark .registration-form-body .field-input:autofill:active {
    -webkit-text-fill-color: #f1f5f9 !important;
    caret-color: #f1f5f9 !important;
    border-color: #475569 !important;
    -webkit-box-shadow: 0 0 0 1000px #1e293b inset !important;
    box-shadow: 0 0 0 1000px #1e293b inset !important;
    transition: background-color 5000s ease-in-out 0s, color 5000s ease-in-out 0s;
    animation-name: registrationWebkitAutofill;
    animation-duration: 0.001s;
}