/* Add New PURCHASER: isolated page styles */
#avd-ui-new-customer-root #avd-new-customer-form fieldset.form-group.row {
    display: block !important;
    border: 1px solid #d5d8de !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    margin: 0 0 12px 0 !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 46px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}

#avd-ui-new-customer-root #avd-new-customer-form fieldset.form-group.row.avd-required-invalid {
    border-color: #ef4444 !important;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--signature fieldset.form-group.row {
    height: auto !important;
    overflow: visible !important;
    padding: 8px 12px 12px !important;
}

#avd-ui-new-customer-root #avd-new-customer-form fieldset.form-group.row.avd-tick-fieldset {
    height: auto !important;
    overflow: visible !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
}

#avd-ui-new-customer-root #avd-new-customer-form fieldset.form-group.row legend.col-form-label {
    float: none !important;
    width: auto !important;
    max-width: none !important;
    flex: 0 0 auto !important;
    margin: 0 0 2px 8px !important;
    padding: 0 8px !important;
    background: #ffffff !important;
    color: #111111 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.15 !important;
}

#avd-ui-new-customer-root #avd-new-customer-form fieldset.form-group.row > .col-sm-9,
#avd-ui-new-customer-root #avd-new-customer-form fieldset.form-group.row > .col-sm-12 {
    max-width: 100% !important;
    flex: 0 0 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    display: block !important;
    min-height: auto !important;
    flex-grow: 0 !important;
}

#avd-ui-new-customer-root #avd-new-customer-form fieldset.form-group.row .form-control {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 4px !important;
    font-size: 13px !important;
    color: #1f2937 !important;
    height: auto !important;
    min-height: 24px !important;
    line-height: 1.3 !important;
    border-radius: 5px !important;
    vertical-align: middle !important;
}

#avd-ui-new-customer-root #avd-new-customer-form fieldset.form-group.row .form-control:not(textarea) {
    height: 24px !important;
    min-height: 24px !important;
    line-height: 1.2 !important;
    padding-top: 3px !important;
    padding-bottom: 3px !important;
    box-sizing: border-box !important;
}

#avd-ui-new-customer-root #avd-new-customer-form fieldset.form-group.row textarea.form-control {
    height: auto !important;
    min-height: 30px !important;
    line-height: 1.45 !important;
    border-radius: 5px !important;
    resize: vertical;
}

#avd-ui-new-customer-root #avd-new-customer-form fieldset.form-group.row .form-control:focus {
    border: 0 !important;
    box-shadow: none !important;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
    align-items: start;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row fieldset.form-group.row {
    margin: 0 !important;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--name {
    grid-template-columns: 5fr 5fr 2fr 8fr;
    align-items: center;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--identity {
    grid-template-columns: 3fr 3fr 4fr;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--address {
    grid-template-columns: 2fr 2fr 1fr;
    align-items: center;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--contact {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--final {
    grid-template-columns: 2fr 1fr 2fr;
    align-items: center;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--owner-terms {
    grid-template-columns: 30% 70%;
    gap: 12px;
    align-items: stretch;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--owner-terms .avd-purchaser-col {
    display: grid;
    gap: 10px;
    align-items: stretch;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--owner-terms .avd-owner-top-row {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 10px;
    align-items: center;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--owner-terms .avd-purchaser-col .avd-tick-fieldset {
    justify-content: flex-start !important;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--owner-terms .avd-owner-same-fieldset {
    border: 1px solid #d5d8de !important;
    border-radius: 5px !important;
    min-height: 40px;
    padding: 0 10px !important;
    display: flex !important;
    align-items: center !important;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--owner-terms .avd-purchaser-col--right {
    height: 100%;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--owner-terms .avd-purchaser-col--right > fieldset.form-group.row {
    height: 100% !important;
    min-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--owner-terms .avd-purchaser-col--right > fieldset.form-group.row > .col-sm-9 {
    flex: 1 1 auto !important;
    display: flex !important;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-datetime-display {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 50px;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-datetime-display-label {
    font-size: 12px;
    font-weight: 500;
    color: #111111;
    white-space: nowrap;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-datetime-display-value {
    font-size: 13px;
    color: #1f2937;
    white-space: nowrap;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-footer-row .avd-datetime-display {
    height: auto;
    min-height: 24px;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-footer-actions {
    margin-left: auto;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--signature {
    grid-template-columns: 1fr 1fr;
    margin-bottom: 0 !important;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--signature fieldset.form-group.row {
    margin-bottom: 0 !important;
}

#avd-ui-new-customer-root #avd-new-customer-form fieldset.form-group.row.avd-signature-fieldset {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    padding: 8px 12px 12px !important;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-terms-wrap {
    width: 100%;
    height: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-terms-wrap > label {
    margin-top: auto !important;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-terms-text {
    font-size: 13px;
    color: #374151;
    line-height: 1.6;
    margin-bottom: 10px;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--licence-upload {
    grid-template-columns: 1fr 1fr;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-tick-wrap {
    display: flex;
    align-items: center;
    min-height: 32px;
    font-size: 12px;
    font-weight: 500;
    color: #111111;
    padding: 0 4px;
}

#avd-ui-new-customer-root #avd-new-customer-form fieldset.form-group.row.avd-tick-fieldset,
#avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row .avd-tick-fieldset {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    height: auto !important;
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-signature-wrap {
    width: 100%;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-signature-pad {
    display: block;
    width: 100%;
    height: 160px !important;
    border: 1px solid #d5d8de;
    border-radius: 5px;
    background: #ffffff;
    touch-action: none;
    cursor: crosshair;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-signature-pad.avd-invalid-signature {
    border-color: #ef4444 !important;
    background: #ffffff !important;
    box-shadow: none !important;
}

#avd-ui-new-customer-root #avd-new-customer-form #avd-terms-accept-check.avd-invalid-check {
    outline: 2px solid #ef4444 !important;
    outline-offset: 1px;
    background: transparent !important;
    box-shadow: none !important;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-licence-upload-card {
    --avd-licence-preview: none;
    position: relative;
    display: block;
    width: 100%;
    min-height: 170px;
    border-radius: 10px;
    background: #edf1f6;
    border: 1px solid #d7dfe9;
    padding: 12px;
    cursor: pointer;
    overflow: hidden;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-licence-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 4;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-licence-scan-frame {
    position: absolute;
    left: 10px;
    right: 10px;
    top: 10px;
    bottom: 10px;
    border: 3px solid #35e3c7;
    border-radius: 9px;
    box-shadow: 0 0 0 1px rgba(53, 227, 199, 0.35), 0 0 22px rgba(53, 227, 199, 0.22);
    pointer-events: none;
    z-index: 1;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-licence-card-shell {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 136px;
    border-radius: 8px;
    padding: 14px;
    background-image: linear-gradient(150deg, rgba(25, 34, 61, 0.96), rgba(46, 63, 108, 0.9)), var(--avd-licence-preview);
    background-size: cover;
    background-position: center;
    color: #ffffff;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-licence-upload-card.has-file .avd-licence-card-shell {
    color: #e5f2ff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-licence-card-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

#avd-ui-new-customer-root #avd-new-customer-form .avd-licence-card-hint {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    opacity: 0.92;
}

@media (max-width: 992px) {
    #avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row {
        grid-template-columns: 1fr !important;
    }

    /* Mobile/Tablet: keep "No Second Name" beside "Second Name" */
    #avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--name {
        grid-template-columns: minmax(0, 1fr) auto !important;
        column-gap: 8px !important;
        row-gap: 10px !important;
        align-items: center !important;
    }

    #avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--name > fieldset.form-group.row:nth-child(1),
    #avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--name > fieldset.form-group.row:nth-child(4) {
        grid-column: 1 / -1 !important;
    }

    #avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--name > fieldset.form-group.row:nth-child(2) {
        grid-column: 1 / 2 !important;
    }

    #avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--name > fieldset.form-group.row.avd-tick-fieldset {
        grid-column: 2 / 3 !important;
        justify-self: end !important;
        align-self: center !important;
        margin-top: 0 !important;
    }

    #avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--name > fieldset.form-group.row.avd-tick-fieldset .avd-tick-wrap {
        min-height: 30px !important;
        padding: 0 !important;
        white-space: nowrap !important;
    }

    /* Mobile/Tablet: keep "Same as Residential" beside "Postal Address" */
    #avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--address {
        grid-template-columns: minmax(0, 1fr) auto !important;
        column-gap: 8px !important;
        row-gap: 10px !important;
        align-items: center !important;
    }

    #avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--address > fieldset.form-group.row:nth-child(1) {
        grid-column: 1 / -1 !important;
    }

    #avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--address > fieldset.form-group.row:nth-child(2) {
        grid-column: 1 / 2 !important;
    }

    #avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--address > fieldset.form-group.row.avd-tick-fieldset {
        grid-column: 2 / 3 !important;
        justify-self: end !important;
        align-self: center !important;
        margin-top: 0 !important;
    }

    #avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--address > fieldset.form-group.row.avd-tick-fieldset .avd-tick-wrap {
        min-height: 30px !important;
        padding: 0 !important;
        white-space: nowrap !important;
    }

    /* Mobile/Tablet: keep "Same as Purchaser" beside owner field */
    #avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--owner-terms .avd-owner-top-row {
        grid-template-columns: minmax(0, 1fr) auto !important;
        column-gap: 8px !important;
        row-gap: 10px !important;
        align-items: center !important;
    }

    #avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--owner-terms .avd-owner-top-row > fieldset.form-group.row:first-child {
        grid-column: 1 / 2 !important;
    }

    #avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--owner-terms .avd-owner-top-row > fieldset.form-group.row.avd-owner-same-fieldset {
        grid-column: 2 / 3 !important;
        justify-self: end !important;
        align-self: center !important;
        min-height: 50px !important;
        margin: 0 !important;
    }

    #avd-ui-new-customer-root #avd-new-customer-form .avd-purchaser-row--owner-terms .avd-owner-top-row > fieldset.form-group.row.avd-owner-same-fieldset .avd-tick-wrap {
        min-height: 30px !important;
        padding: 0 !important;
        white-space: nowrap !important;
    }
}
