/* Register / create-plan steps: personal details, child, existing child, plan step, mobile footer */

/* Register > personal info (name, email, mobile, password).
   The block used to switch between three looks by screen size - inline labels
   with underlined 30px inputs (768-1440px), filled stacked inputs (phones and
   1441px+) - and the phone field was shorter than the rest. intl-input.min.css
   also sized the dial code and typed text from the screen (vmin), which on
   large-text browsers squeezed the Mobile box until there was nowhere to type.
   One layout for every width: label above, 48px filled inputs, two columns,
   single column for Mobile/Password on phones. */
#ps-bottom .process-form {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 640px;
    margin: 0 auto;
}
#ps-bottom .process-form > div {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    /* top-aligned: a "Valid" / error line under one field used to push its
       neighbour down to the middle of the row */
    justify-content: flex-start !important;
    width: auto !important;
    min-width: 0;
}
#ps-bottom .process-form > div:only-child {
    grid-column: 1 / -1;
}
#ps-bottom .process-form p {
    width: auto !important;
    margin: 0 0 6px !important;
    text-align: start;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    color: #692525;
}
#ps-bottom .process-form .field-input {
    margin: 0 !important;
    width: 100% !important;
    border: 0 !important;
    text-align: start;
}
#ps-bottom .process-form input[type='text'],
#ps-bottom .process-form input[type='email'],
#ps-bottom .process-form input[type='password'],
#ps-bottom .process-form .iti input[type='tel'] {
    display: block;
    width: 100% !important;
    height: 48px !important;
    box-sizing: border-box;
    background: #f2f3f5 !important;
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    color: #333;
    transition: border-color 0.2s, background-color 0.2s;
}
#ps-bottom .process-form input[type='text'],
#ps-bottom .process-form input[type='email'],
#ps-bottom .process-form input[type='password'] {
    padding: 0 14px !important;
}
/* padding-left stays with intl-tel-input, which sizes it to the dial code */
#ps-bottom .process-form .iti input[type='tel'] {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-right: 14px !important;
}
#ps-bottom .process-form input:focus {
    outline: none;
    background: #fff !important;
    border-color: #dbc195 !important;
}
#ps-bottom .process-form .iti {
    display: block;
    width: 100%;
}
#ps-bottom .process-form .iti__flag-container,
#ps-bottom .process-form .iti__selected-flag {
    height: 48px !important;
}
#ps-bottom .process-form .iti__selected-flag {
    /* Arabic pages are rtl, which printed the code as "971+" */
    direction: ltr;
    background: transparent !important;
    padding: 0 12px 0 14px;
    border-radius: 8px 0 0 8px;
    position: relative;
}
/* divider between the dial code and the number */
#ps-bottom .process-form .iti__selected-flag::after {
    content: '';
    position: absolute;
    right: 0;
    top: 12px;
    bottom: 12px;
    width: 1px;
    background: #d6cdbf;
}
#ps-bottom .process-form .iti--separate-dial-code .iti__selected-dial-code {
    font-size: 15px;
    color: #333;
}
/* country dropdown: flag + dial code only, a compact panel under the flag
   button. It was ~460px wide with full country names, anchored to the
   button's right edge, so in Arabic it ran off the left of the screen. */
#ps-bottom .process-form .iti__country-list {
    left: 0;
    right: auto;
    width: 150px;
    max-height: 260px;
    margin-top: 6px;
    padding: 6px 0;
    overflow-y: auto;
    direction: ltr;
    white-space: nowrap;
    background: #fff;
    border: 1px solid #ece6dc;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(105, 37, 37, 0.14);
    z-index: 20;
}
#ps-bottom .process-form .iti__country,
.iti--container .iti__country {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    margin: 0 6px;
    border-radius: 6px;
    line-height: 20px;
    cursor: pointer;
}
#ps-bottom .process-form .iti__country-name,
.iti--container .iti__country-name {
    display: none;
}
#ps-bottom .process-form .iti__flag-box,
.iti--container .iti__flag-box {
    order: 0;
    margin: 0;
    flex: 0 0 20px;
}
#ps-bottom .process-form .iti__dial-code,
.iti--container .iti__dial-code {
    order: 1;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}
#ps-bottom .process-form .iti__country.iti__highlight,
.iti--container .iti__country.iti__highlight {
    background: #f6efe2;
}
#ps-bottom .process-form .iti__country.iti__active .iti__dial-code,
.iti--container .iti__country.iti__active .iti__dial-code {
    color: #692525;
}
#ps-bottom .process-form .iti__divider,
.iti--container .iti__divider {
    margin: 6px 12px;
    padding: 0;
    border-bottom: 1px solid #ece6dc;
}
/* phones: intl-tel-input opens the list as a full-screen popup attached to
   <body> - same flag + code rows, shown as a centred panel instead of a
   sheet covering the whole screen */
.iti-mobile .iti--container {
    top: 12vh !important;
    bottom: 12vh !important;
    left: 50% !important;
    right: auto !important;
    width: 180px !important;
    transform: translateX(-50%);
    padding: 0 !important;
}
.iti--container .iti__country-list {
    position: relative;
    width: 100%;
    max-height: 100%;
    padding: 6px 0;
    overflow-y: auto;
    direction: ltr;
    white-space: nowrap;
    background: #fff;
    border: 1px solid #ece6dc;
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
}
/* inline validation - the message sits under its field, no popup */
#ps-bottom .field-error {
    display: none;
    margin-top: 6px;
    font-size: 13px;
    line-height: 18px;
    color: #d93025;
    text-align: start;
}
#ps-bottom .field-error.text-center {
    text-align: center;
}
#ps-bottom .field-error.show {
    display: block;
}
#ps-bottom .process-form input.is-invalid,
#ps-bottom .process-form .iti input.error {
    background: #fff6f5 !important;
    border-color: #e5484d !important;
}
#ps-bottom #due_date.is-invalid {
    border-bottom-color: #e5484d !important;
}
#ps-bottom .register-alert {
    display: none;
    max-width: 640px;
    margin: 0 auto 16px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #fdecea;
    color: #a1271c;
    font-size: 14px;
    line-height: 20px;
}
#ps-bottom .register-alert.show {
    display: block;
}
#ps-bottom .theme-btn.is-loading {
    opacity: 0.6;
    pointer-events: none;
}
#ps-bottom .process-form #error-msg {
    color: #d93025;
}
#ps-bottom .process-form #valid-msg,
#ps-bottom .process-form #error-msg {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    line-height: 18px;
    text-align: start;
}
#ps-bottom .process-form #valid-msg.hide,
#ps-bottom .process-form #error-msg.hide {
    display: none;
}
@media (max-width: 575px) {
    #ps-bottom .process-form {
        gap: 12px;
    }
    /* Mobile + Password: one per row on a phone, the dial code needs the room */
    #ps-bottom .process-form:has(#my_phone) {
        grid-template-columns: 1fr;
    }
}

        /* Child step (name / gender / birthday, habits / allergies) and the existing-
           child picker: same look as the personal details - label above, 48px filled
           fields, two columns, the message under its own field. */
        .be-form-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
            max-width: 640px;
            margin: 0 auto;
        }
        .be-span-2 {
            grid-column: 1 / -1;
        }
        .be-field {
            display: flex;
            flex-direction: column;
            min-width: 0;
            text-align: start;
        }
        .be-field label {
            margin: 0 0 6px;
            font-size: 14px;
            font-weight: 600;
            line-height: 20px;
            color: #692525;
        }
        .be-field input,
        .be-field select,
        .be-field textarea {
            display: block;
            width: 100% !important;
            height: 48px !important;
            box-sizing: border-box;
            margin: 0 !important; /* the site's select rule pulls it up 10px */
            padding: 0 14px !important;
            background-color: #f2f3f5 !important;
            border: 1px solid transparent !important;
            border-radius: 8px !important;
            font-size: 15px !important;
            line-height: 46px;
            color: #333;
            box-shadow: none;
            outline: none;
            transition: border-color 0.2s, background-color 0.2s;
        }
        .be-field select {
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            cursor: pointer;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23692525' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
            background-repeat: no-repeat !important;
            background-size: 12px 8px !important;
            background-position: right 14px center !important;
            padding-right: 40px !important;
        }
        .be-field textarea {
            height: auto !important;
            min-height: 96px;
            padding: 12px 14px !important;
            line-height: 22px;
            resize: vertical;
        }
        .be-field input:focus,
        .be-field select:focus,
        .be-field textarea:focus {
            background-color: #fff !important;
            border-color: #dbc195 !important;
        }
        .be-field .ie-invalid {
            background-color: #fff6f5 !important;
            border-color: #e5484d !important;
        }
        /* child step actions */
        .be-actions {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            width: 100%;
            max-width: 640px;
            margin: 40px auto;
        }
        .be-actions-single {
            justify-content: center;
        }
        .be-actions .be-btn-primary,
        .be-actions .be-btn-secondary {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 180px;
            height: 48px;
            margin: 0 !important;
            padding: 0 28px !important;
            border-radius: 10px !important;
            font-size: 15px !important;
            line-height: 1 !important;
            text-decoration: none;
        }
        .be-actions .be-btn-secondary {
            min-width: 120px;
            background: transparent;
            border: 1px solid #d4b78f;
            color: #692525;
            font-weight: 600;
            transition: background-color 0.2s;
        }
        .be-actions .be-btn-secondary:hover {
            background: #f6efe2;
            color: #692525;
        }
        @media (max-width: 767px) {
            /* the register container drops its padding on phones; the details step had
               its own wrapper padding but the child step ran edge to edge */
            #ps1-bottom .container > .row {
                margin-left: 0;
                margin-right: 0;
            }
            #ps1-bottom .container > .row > [class*='col-'],
            #ps0-bottom .container > .be-form-grid,
            #ps0-bottom .container > [class*='col-'] {
                padding-left: 16px !important;
                padding-right: 16px !important;
            }
            #ps0-bottom .container > .be-form-grid {
                max-width: none;
            }
        }
        @media (max-width: 575px) {
            .be-actions .be-btn-secondary {
                flex: 0 0 auto;
            }
            .be-actions .be-btn-primary {
                flex: 1 1 auto;
                min-width: 0;
            }
        }
        /* existing-child picker: one field, centred, message underneath */
        .be-form-narrow {
            max-width: 360px;
        }
        @media (max-width: 575px) {
            .be-form-grid {
                gap: 12px;
            }
        }

        @media (max-width: 1023px) {
            /* plan step cards: responsive.css gave the meal cards 0 5px but the farming
               and plan-type cards 0, so the plan cards touched - one 10px gap for all */
            .ftst2 .farming-type .organicnon,
            .ftst3 .farming-type .organicnon,
            .ftst4 .farming-type .organicnon {
                width: auto !important;
                flex: 1 1 0;
                margin: 0 5px !important;
            }

            /* mobile plan footer: summary + total on one row, full-width checkout below.
               The old grid expected an <a> button (it is a <button>), so the button sat
               half-width in the middle and the total had its own dark block. */
            .processfooter .footer-bottom {
                padding: 0 !important;
            }
            .processfooter .footer-bottom .container .inner-container {
                display: grid !important;
                grid-template-columns: minmax(0, 1fr) auto;
                align-items: center;
                gap: 10px 14px;
                padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
                background: #4f1414;
                box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.18);
            }
            .processfooter .footer-bottom .container .inner-container::after {
                display: none;
            }
            .processfooter .footer-bottom .container .inner-container div.left-content {
                grid-column: 1;
                grid-row: 1;
                float: none !important;
                padding: 0 !important;
                min-width: 0;
                text-align: start;
            }
            .processfooter .footer-bottom .left-content .copyright {
                display: block !important;
                margin: 0 !important;
                text-align: start !important;
            }
            .processfooter .footer-bottom .left-content .copyright .pf-info {
                margin: 0 !important;
                font-size: 13px !important;
                line-height: 19px !important;
                color: rgba(255, 255, 255, 0.85) !important;
            }
            .processfooter .footer-bottom .left-content .copyright:first-child .pf-info {
                color: #fff !important;
                font-weight: 600;
            }
            .processfooter .footer-bottom .container .inner-container div.totalinfo {
                grid-column: 2;
                grid-row: 1;
                float: none !important;
                margin: 0 !important;
                padding: 0 !important;
                background: none !important;
                text-align: end;
            }
            .processfooter .totalinfo h3 {
                margin: 0 !important;
                font-size: 12px !important;
                font-weight: 400 !important;
                line-height: 16px;
                color: rgba(255, 255, 255, 0.75) !important;
            }
            .processfooter .totalinfo h2 {
                margin: 2px 0 0 !important;
                font-size: 20px !important;
                font-weight: 700 !important;
                line-height: 26px;
                white-space: nowrap;
            }
            .processfooter .footer-bottom .container .inner-container div.chkbtn {
                grid-column: 1 / -1;
                grid-row: 2;
                float: none !important;
                width: 100%;
                margin: 0 !important;
            }
            .processfooter .chkbtn .co-btn {
                display: block;
                width: 100%;
                height: 48px;
                padding: 0 !important;
                border-radius: 10px !important;
                font-size: 15px !important;
                line-height: 48px !important;
            }
            .bodypb {
                padding-bottom: 170px !important;
            }
        }
