﻿/* =========================================================
   WITHDRAWAL REQUEST FORM — RESPONSIVE LAYOUT
   Compatible with standalone and embedded iframe on petloc8.com
========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Reset only inside the withdrawal form */
.form-main-wrapper,
.form-main-wrapper *,
.form-main-wrapper *::before,
.form-main-wrapper *::after {
    box-sizing: border-box;
}

/* Body / outer wrapper */
body.form-main-wrapper {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: #ffffff;
    color: #202944;
    font-family: "Circular Std", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Inner wrapper shares the same class as the body in the existing PHP */
body.form-main-wrapper>.form-main-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding-top: 20px;
}

.form-main-wrapper .withdrawal-page {
    width: 100%;
    margin: 0;
    padding: 0;
}

.withdrawal-form-wrapper .page-width {
    padding-right: 25px;
    padding-left: 25px;
}

/* Heading */
.form-main-wrapper .Withdrawal-h2 {
    width: 100%;
    margin: 0 0 30px;
    padding: 0;
    color: #1C243C;
    font-family: inherit;
    font-size: 40px;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0;
    text-align: center;
    text-transform: none;
}

/* Form layout */
.form-main-wrapper form#withdrawalForm {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.form-main-wrapper .withdrawal-grid {
    display: flex;
    flex-wrap: wrap;
    column-gap: 60px;
    row-gap: 16px;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0;
    align-items: end;
}

.form-main-wrapper .withdrawal-grid .input-field {
    width: calc(50% - 30px);
}

/* Labels */
.form-main-wrapper .withdrawal-grid label {
    display: flex;
    margin: 0 0 4px;
    color: #1C243C;
    font-family: inherit;
    font-size: 14px;
    font-weight: 450;
    line-height: 1.2;
    text-align: left;
    gap: 0px;
}

.form-main-wrapper .withdrawal-grid label span {
    margin-left: 0;
    color: #f04428;
}

/* Inputs and select fields */
.form-main-wrapper .withdrawal-grid input:not([type="file"]):not([type="hidden"]),
.form-main-wrapper .withdrawal-grid select,
.form-main-wrapper .withdrawal-grid textarea {
    display: block;
    width: 100%;
    height: 54px;
    min-height: 54px;
    margin: 0;
    padding: 4px 20px;
    border: 1px solid #D4D2CD;
    border-radius: 100px;
    outline: none;
    background: #ffffff;
    color: #1C243C;
    font-family: inherit;
    font-size: 16px;
    font-weight: 450;
    line-height: 1.2;
    box-shadow: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    text-align: justify;
}

.form-main-wrapper .withdrawal-grid input::placeholder,
.form-main-wrapper .withdrawal-grid textarea::placeholder {
    color: #777C8A;
    opacity: 1;
    font-family: inherit;
}

/*.form-main-wrapper .withdrawal-grid input:not([type="file"]):not([type="hidden"]):focus,
.form-main-wrapper .withdrawal-grid select:focus,
.form-main-wrapper .withdrawal-grid textarea:focus {
    border-color:#1A8917 !important;
    outline: none;
    box-shadow: none;
}*/
/* Green border when other fields are focused OR filled */
.form-main-wrapper .withdrawal-grid input:not([type="file"]):not([type="hidden"]):not([name="purchase_date"]):focus,
.form-main-wrapper .withdrawal-grid select:focus,
.form-main-wrapper .withdrawal-grid textarea:focus,
.form-main-wrapper .withdrawal-grid input.filled:not([type="file"]):not([type="hidden"]):not([name="purchase_date"]),
.form-main-wrapper .withdrawal-grid select.filled,
.form-main-wrapper .withdrawal-grid textarea.filled {
    border-color: #1A8917 !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Request date always keeps its normal border */
/*.form-main-wrapper .withdrawal-grid .field-request-date input[name="purchase_date"],
.form-main-wrapper .withdrawal-grid .field-request-date input[name="purchase_date"]:focus {
    border: 1px solid #D6D3D1 !important;
    outline: none !important;
    box-shadow: none !important;
}*/

/* Keep the Request date field's original styling */
.form-main-wrapper .withdrawal-grid input[name="request_date"] {
    border-color: initial;
}

/* Request date */
.form-main-wrapper .withdrawal-grid input.bg_light_grey {
    border: 1px solid transparent !important;
    background: #F2F1EF !important;
    color: #202944 !important;
    font-weight: 450 !important;
    box-shadow: none !important;
    cursor: default;
}

.form-main-wrapper .country-select:valid {
    color: #1C243C !important;
}

input[type="date"]::-webkit-calendar-picker-indicator {
      display: none; 
}
/* Purchase date */
.form-main-wrapper input.purchase_date_wrap {
    width: 100%;
    height: 54px;
    border-radius: 50px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.form-main-wrapper input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
}

/* Country select */
.form-main-wrapper .country-field {
    width: 100%;
    min-width: 0;
}

.form-main-wrapper .country-select-wrapper {
    position: relative;
    width: 100%;
    height: 54px;
    margin: 0;
    padding: 0;
}

.form-main-wrapper .withdrawal-grid select.country-select {
    width: 100%;
    height: 54px;
    min-height: 54px;
    margin: 0;
    padding: 4px 20px;
    border: 1px solid #D4D2CD;
    border-radius: 100px;
    background: #ffffff;
    color: #777f93;
    font-family: inherit;
    font-size: 16px;
    font-weight: 450;
    cursor: pointer;
    outline: none;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    line-height: 120%;
    -moz-appearance: none;
}

.form-main-wrapper .country-select::-ms-expand {
    display: none;
}

.form-main-wrapper .country-select:valid {
    color: #202944;
}

.form-main-wrapper .country-select option {
    color: #202944;
    background: #ffffff;
    font-family: inherit;
    font-size: 14px;
}

.form-main-wrapper .country-select option[value=""] {
    color: #777f93;
}

.form-main-wrapper .country-select-icon {
    position: absolute;
    top: 50%;
    right: 21px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    transform: translateY(-50%);
    pointer-events: none;
}

.form-main-wrapper .country-select-icon svg {
    display: block;
    width: 20px;
    height: 20px;
}
.form-main-wrapper .country-select-icon svg path {
    fill: #777C8A;
}
/* Invoice upload */
.form-main-wrapper .upload-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    width: 100%;
    min-width: 0;
    height: 54px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.form-main-wrapper .upload-wrapper input[type="file"],
.form-main-wrapper #invoice-upload {
    display: none !important;
}

.form-main-wrapper .upload-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100% !important;
    height: 54px !important;
    min-height: 54px;
    margin: 0 !important;
    padding: 7px 60px 7px 20px !important;
    border: 0 !important;
    border-radius: 100px !important;
    outline: 0 !important;
    background: #168b17 !important;
    color: #ffffff !important;
    font-family: inherit !important;
    font-size: 16px !important;
    font-weight: 450 !important;
    line-height: 1.2 !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    text-transform: none;
    box-shadow: none !important;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: background-color 0.2s ease;
}

.form-main-wrapper .upload-btn::first-letter {
    text-transform: uppercase;
}


.form-main-wrapper .upload-btn::after {
    content: "";
    position: absolute;
    top: 0;
    right: 6px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #202944;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.82-2.83l8.48-8.48'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px 16px;
    bottom: 0;
    margin: auto 0;
}

.form-main-wrapper .upload-btn:hover {
    background: #117b14 !important;
    color: #ffffff !important;
}

.form-main-wrapper .upload-btn:focus,
.form-main-wrapper .upload-btn:focus-visible,
.form-main-wrapper .upload-btn:active {
    outline: none !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* File preview */
.form-main-wrapper .file-preview {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100% !important;
    min-width: 0;
    height: 54px;
    margin: 0;
    padding: 7px 0;
    border: 1px solid transparent;
    border-radius: 50px;
    background: #ffffff;
    box-shadow: none;
}

.form-main-wrapper .file-info {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}

.form-main-wrapper .file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 25px;
    height: 25px;
}

.form-main-wrapper .file-icon svg {
    display: block;
    /* width: 18px;
    height: 18px; */
}

.form-main-wrapper .file-name {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #1C243C;
    font-family: inherit;
    font-size: 18px;
    font-weight: 450;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height:1.4;
}

.form-main-wrapper .file-preview .remove-file {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    min-width: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    outline: none;
    cursor: pointer;
}

.form-main-wrapper .file-preview .remove-file svg {
    display: block;
    /* width: 26px;
    height: 30px; */
}

/* Submit button */
.form-main-wrapper .button--primary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 500px;
    max-width: 100%;
    min-width: 0;
    height: 54px;
    min-height: 54px;
    margin: 30px auto 0;
    padding: 17px 60px 17px 17px;
    border: 0 !important;
    border-radius: 100px;
    outline: none !important;
    font-family: inherit !important;
    font-size: 16px;
    font-weight: 450;
    line-height: 1.2;
    letter-spacing: 0;
    text-align: left;
    text-transform: none;
    box-shadow: none !important;
    opacity: 1;
    transition: background-color 0.2s ease;
}

.form-main-wrapper .button--primary::after {
    content: "";
    display: block;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #818797;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m12 5 7 7-7 7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px 22px;
    top: 0;
    position: absolute;
    bottom: 0;
    right: 6px;
    margin: auto 0;
}

.form-main-wrapper .button--primary:disabled {
    background: #d5d3cf !important;
    color: #ffffff !important;
    cursor: not-allowed;
}

.form-main-wrapper .button--primary:not(:disabled) {
    background: #168b17 !important;
    color: #ffffff !important;
    cursor: pointer;
}

.form-main-wrapper .button--primary:not(:disabled)::after {
    background-color: #202944;
}

.form-main-wrapper .button--primary:not(:disabled):hover {
    background: #117b14 !important;
    color: #ffffff !important;
}

.form-main-wrapper .button--primary:focus,
.form-main-wrapper .button--primary:focus-visible,
.form-main-wrapper .button--primary:active {
    outline: none !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* Success message */
.form-main-wrapper #successMessage {
    display: none;
    width: 100%;
    max-width: 1180px;
    margin: 0px auto;
}

.form-main-wrapper .withdrawal-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
}

.form-main-wrapper .success-icon {
    margin-bottom: 0px;
}

.form-main-wrapper .success-icon svg {
    display: block;
    max-width: 100%;
    width: 40px;    
    height: 40px;
}

.form-main-wrapper .success-text {
    color: #1A8917;
    font-family: inherit !important;
    font-size: 24px;
    font-weight: 700 !important;
    line-height: 1.2;
    text-align: center;
}

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    body.form-main-wrapper>.form-main-wrapper {
        padding: 20px 0 20px;
        border-radius: 28px;
    }


    .form-main-wrapper .withdrawal-grid {
        column-gap: 30px;
        row-gap: 20px;
    }

    .form-main-wrapper .withdrawal-grid .input-field {
        width: calc(50% - 15px);
    }

    .withdrawal-form-wrapper iframe {
        height: 660px;
    }
}

/* Mobile (727px and below inside iframe, corresponds to parent browser <= 767px) */
@media (max-width: 727px) {
    .withdrawal-form-wrapper iframe {
        height: 1120px;
    }

    .form-main-wrapper .Withdrawal-h2 {
        margin: 0 0 32px;
    }

    .form-main-wrapper .withdrawal-grid .input-field {
        width: 100%;
    }

    /* Keep the existing field order on mobile */
    .form-main-wrapper .withdrawal-grid>div:nth-child(1) {
        order: 1;
    }

    .form-main-wrapper .withdrawal-grid>div:nth-child(3) {
        order: 2;
    }

    .form-main-wrapper .withdrawal-grid>div:nth-child(5) {
        order: 3;
    }

    .form-main-wrapper .withdrawal-grid>div:nth-child(7) {
        order: 4;
    }

    .form-main-wrapper .withdrawal-grid>div:nth-child(9) {
        order: 5;
    }

    .form-main-wrapper .withdrawal-grid>div:nth-child(2) {
        order: 6;
    }

    .form-main-wrapper .withdrawal-grid>div:nth-child(4) {
        order: 7;
    }

    .form-main-wrapper .withdrawal-grid>div:nth-child(6) {
        order: 8;
    }

    .form-main-wrapper .withdrawal-grid>div:nth-child(8) {
        order: 9;
    }

    .form-main-wrapper .withdrawal-grid>div:nth-child(10) {
        order: 10;
    }

    .form-main-wrapper .withdrawal-grid input:not([type="file"]):not([type="hidden"]),
    .form-main-wrapper .withdrawal-grid select,
    .form-main-wrapper .withdrawal-grid textarea,
    .form-main-wrapper .country-select-wrapper {
        height: 52px;
        min-height: 52px;
    }

    .form-main-wrapper .withdrawal-grid select.country-select {
        height: 52px;
        min-height: 52px;
    }

    .form-main-wrapper .upload-wrapper {
        height: 52px;
    }

    .form-main-wrapper .upload-btn {
        height: 52px !important;
        min-height: 52px;
        padding-left: 17px !important;
        font-size: 14px !important;
    }


    .form-main-wrapper .file-preview {
        height: 52px;
    }

    .form-main-wrapper .button--primary {
        width: 100%;
        max-width: 100%;
        margin: 32px auto 0;
    }

    /* .form-main-wrapper #successMessage {
        margin: 35px auto;
    } */

    /* .form-main-wrapper .success-text {
        font-size: 14px;
    } */
}
