/* Register form – override Porto float layout, fix grid, choice fields, validation */

.customer-account-create .form.create.account.form-create-account {
    max-width: 920px;
    margin: 0 auto;
    float: none;
    width: 100%;
    padding-top: 1.5rem;
    padding-bottom: 2rem;
}

.customer-account-create .form.create.account.form-create-account::after {
    content: '';
    display: table;
    clear: both;
}

.customer-account-create .form.create.account.form-create-account > .b2b-register-sections,
.customer-account-create .form.create.account.form-create-account > .fieldset.additional_info,
.customer-account-create .form.create.account.form-create-account > .actions-toolbar {
    float: none;
    width: 100%;
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
    clear: both;
}

.customer-account-create .form.create.account.form-create-account > .fieldset:not(.b2b-register-section),
.customer-account-create .form.create.account.form-create-account .b2b-register-sections > .fieldset:not(.b2b-register-section) {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
}

.customer-account-create .form.create.account.form-create-account .b2b-register-sections > .fieldset.b2b-register-section {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 28px 32px 24px !important;
    box-sizing: border-box;
}

.customer-account-create .form-create-account .b2b-register-sections {
    margin-bottom: 24px;
}

.customer-account-create .form-create-account .b2b-register-section,
.customer-account-create .form.create.account .b2b-register-sections > fieldset.b2b-register-section {
    width: 100%;
    float: none;
    background: #fff;
    border: 1px solid #e7eaf0;
    border-radius: 6px;
    padding: 28px 32px 24px !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    margin: 0;
    box-sizing: border-box;
}

.customer-account-create .form-create-account .b2b-register-section + .b2b-register-section {
    margin-top: 18px;
}

.customer-account-create .form-create-account .b2b-register-section > .legend {
    border-bottom: 1px solid #eef1f6;
    margin-bottom: 18px;
    padding-bottom: 12px;
}

.customer-account-create .form-create-account .b2b-register-section > .legend span {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.customer-account-create .form-create-account .b2b-register-section > br {
    display: none;
}

/* Reset Porto float field layout */
.customer-account-create .form-create-account .b2b-register-section .field,
.customer-account-create .form-create-account .register-fields-grid .field,
.customer-account-create .form-create-account .register-fields-stack .field {
    float: none;
    width: 100%;
    margin: 0 0 16px;
    padding: 0;
    box-sizing: border-box;
}

.customer-account-create .form-create-account .b2b-register-section .field .label,
.customer-account-create .form-create-account .register-fields-grid .field .label,
.customer-account-create .form-create-account .register-fields-stack .field .label {
    float: none;
    width: auto;
    text-align: left;
    padding: 0;
    margin: 0 0 6px;
    display: block;
    font-weight: 500;
}

.customer-account-create .form-create-account .b2b-register-section .field .control,
.customer-account-create .form-create-account .register-fields-grid .field .control,
.customer-account-create .form-create-account .register-fields-stack .field .control {
    float: none;
    width: 100%;
    margin: 0;
    padding: 0;
}

.customer-account-create .form-create-account .b2b-register-section .field .control .input-text,
.customer-account-create .form-create-account .b2b-register-section .field .control select,
.customer-account-create .form-create-account .b2b-register-section .field .control textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
}

/* Checkbox / choice fields – keep checkbox and label on one line */
.customer-account-create .form-create-account .field.choice {
    display: block;
    margin-bottom: 12px;
}

.customer-account-create .form-create-account .field.choice > input[type="checkbox"] {
    float: left;
    width: auto;
    margin: 2px 8px 0 0;
}

.customer-account-create .form-create-account .field.choice > .label {
    display: inline;
    float: none;
    width: auto;
    margin: 0;
    padding: 0;
    font-weight: normal;
    line-height: 1.5;
    vertical-align: middle;
}

.customer-account-create .form-create-account .field.choice > .field-tooltip {
    clear: both;
    margin-top: 8px;
}

.customer-account-create .form-create-account .field.choice::after {
    content: '';
    display: table;
    clear: both;
}

/* Required asterisk */
.customer-account-create .form-create-account .field.required > .label:after,
.customer-account-create .form-create-account .field._required > .label:after {
    content: '*';
    color: #e02b27;
    font-size: 1.2rem;
    margin: 0 0 0 5px;
}

.customer-account-create .form-create-account .field.choice .label:after {
    content: none;
}

/* Account section: two-column grid */
.customer-account-create .form-create-account .register-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 20px;
    width: 100%;
    margin: 0;
    padding: 0;
}

.customer-account-create .form-create-account .register-fields-grid > .field,
.customer-account-create .form-create-account .register-fields-grid > .field-name-firstname,
.customer-account-create .form-create-account .register-fields-grid > .field-name-lastname {
    min-width: 0;
}

.customer-account-create .form-create-account .register-field--full,
.customer-account-create .form-create-account .register-fields-grid > .field.street,
.customer-account-create .form-create-account .register-fields-grid > .field.password,
.customer-account-create .form-create-account .register-fields-grid > .field.confirmation,
.customer-account-create .form-create-account .register-fields-grid > .field.choice,
.customer-account-create .form-create-account .register-fields-grid > .field.newsletter,
.customer-account-create .form-create-account .register-fields-grid > .field.taxvat,
.customer-account-create .form-create-account .register-fields-grid > .register-field--full {
    grid-column: 1 / -1;
}

.customer-account-create .form-create-account .register-fields-grid .field.street .nested .field.additional {
    margin-top: 10px;
}

.customer-account-create .form-create-account .register-fields-grid .field.street .nested .field.additional .label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

/* Address section: single column */
.customer-account-create .form-create-account .register-fields-stack {
    width: 100%;
}

/* Validation: follow Magento mage-error convention (input + error message div) */
.customer-account-create .form-create-account input.mage-error,
.customer-account-create .form-create-account select.mage-error,
.customer-account-create .form-create-account textarea.mage-error {
    border-color: #e5484d !important;
    box-shadow: 0 0 0 1px rgba(229, 72, 77, 0.12);
}

.customer-account-create .form-create-account div.mage-error {
    margin: 5px 0 0;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.4;
    color: #e02b27;
}

.customer-account-create .form-create-account div.mage-error:empty {
    display: none !important;
}

.customer-account-create .form-create-account .password-strength-meter {
    margin-top: 8px;
}

.customer-account-create .form-create-account .actions-toolbar {
    max-width: 920px;
    margin: 8px auto 0;
    padding: 0;
}

.customer-account-create .form-create-account .actions-toolbar .primary {
    float: none;
}

.customer-account-create .form-create-account .actions-toolbar .primary .action.submit {
    min-width: 240px;
    border-radius: 4px;
}

.customer-account-create .form-create-account .fieldset.additional_info {
    float: none;
    width: 100%;
    max-width: 920px;
    margin: 0 auto 14px;
    padding: 0;
}

@media (max-width: 767px) {
    .customer-account-create .form-create-account .register-fields-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .customer-account-create .form-create-account .b2b-register-section,
    .customer-account-create .form.create.account.form-create-account .b2b-register-sections > .fieldset.b2b-register-section {
        padding: 20px 16px 18px !important;
    }

    .customer-account-create .form-create-account .b2b-register-section > .legend span {
        font-size: 18px;
    }
}
