/*
AiST TECH Inquiry Form Design Consistency
Shared by Korean / English / Japanese / Simplified Chinese.

This stylesheet changes presentation only.
Existing form field names, submit logic, DB structure and validation logic are preserved.
*/

.formw {
    width: 100%;
    box-sizing: border-box;
}

.formw .de-form {
    margin-top: 32px !important;
}

.formw .de-form-table {
    border-top: 2px solid #1f4e79;
}

.formw .de-form-tr {
    min-height: 64px;
    border-bottom-color: #e4e9ee;
}

.formw .de-form-th {
    box-sizing: border-box;
    font-weight: 600;
    color: #253545;
    vertical-align: middle;
}

.formw .de-form-td {
    box-sizing: border-box;
    vertical-align: middle;
}

/* Unified control appearance */
.formw .de-form input[type="text"],
.formw .de-form input[type="email"],
.formw .de-form input[type="password"],
.formw .de-form select,
.formw .de-form textarea {
    min-height: 36px;
    padding: 7px 9px;
    border: 1px solid #d8e0e7;
    border-radius: 0;
    background: #fff;
    color: #263746;
    font: inherit;
    line-height: 1.4;
    box-sizing: border-box;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.formw .de-form textarea {
    display: block;
    width: calc(100% - 2px) !important;
    max-width: 100%;
    height: 174px;
    min-height: 174px !important;
    max-height: none !important;
    padding: 8px 10px;
    resize: vertical !important;
    box-sizing: border-box;
    overflow-y: auto;
}

.formw .de-form input[type="text"]:focus,
.formw .de-form input[type="email"]:focus,
.formw .de-form input[type="password"]:focus,
.formw .de-form select:focus,
.formw .de-form textarea:focus {
    border-color: #1f4e79;
    box-shadow: none;
}

.formw .de-form input::placeholder,
.formw .de-form textarea::placeholder {
    color: #98a4af;
    opacity: 1;
}

/* Normal fields */
.formw .de-form input[name="subject"],
.formw .de-form input[name="f5"] {
    width: min(100%, 520px);
}

.formw .de-form input[name="f3"] {
    width: min(100%, 390px);
}

.formw .de-form input[name="f4"] {
    width: min(100%, 220px);
}

/* Korean phone: existing 3-part structure */
.formw .de-form select[name="mobile1"] {
    width: 92px;
}

.formw .de-form input[name="mobile2"],
.formw .de-form input[name="mobile3"] {
    width: 112px;
}

/* Overseas phone: country - area/prefix - number - number */
.formw .de-form input[name="phone_country"] {
    width: 92px;
}

.formw .de-form input[name="phone_area"] {
    width: 112px;
}

/* E-mail */
.formw .de-form input[name="email"] {
    width: 170px;
}

.formw .de-form input[name="direct_dm"] {
    width: 150px;
}

.formw .de-form select[name="mail_dm"] {
    width: 175px;
}


/* Restore the native dropdown arrow hidden by legacy common.css */
.formw .de-form select {
    -webkit-appearance: menulist !important;
    -moz-appearance: menulist !important;
    appearance: auto !important;
    cursor: pointer;
    padding-right: 8px;
}

/* Radio options */
.formw .de-form input[type="radio"] {
    margin-right: 5px;
    vertical-align: -1px;
}

.formw .de-form input[type="radio"] + label {
    display: inline-block;
    margin-right: 18px !important;
    line-height: 1.6;
    cursor: pointer;
}

/* Required mark */
.formw .red_point {
    margin-left: 3px;
}

/* Agreement checkbox area */
.formw .agreeokbtn {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid #e4e9ee;
    border-top: 0;
    background: #fafbfc;
    box-sizing: border-box;
}

/* Anti-spam code */
.formw input[name="keyValue2"] {
    width: 190px;
}

/* Keep legacy dash spacing tidy */
.formw .de-form-td .pl5.pr5,
.formw .de-form-td .pr5.pl5 {
    color: #a1aab3;
}

/* Preserve current responsive site; only prevent form controls from overflowing. */
@media screen and (max-width: 760px) {
    .formw .de-form-td {
        min-width: 0;
    }

    .formw .de-form input[name="f3"],
    .formw .de-form input[name="f4"],
    .formw .de-form input[name="subject"],
    .formw .de-form input[name="f5"] {
        max-width: 100%;
    }

    .formw .de-form input[name="email"],
    .formw .de-form input[name="direct_dm"],
    .formw .de-form select[name="mail_dm"] {
        max-width: 100%;
    }
}


/* Allow the inquiry-content row to grow when the textarea is manually resized. */
@media screen and (min-width: 1025px) {
    .formw .de-form-table .de-form-tr:has(textarea) {
        display: flex;
        align-items: stretch;
        overflow: visible !important;
        clear: both;
    }

    .formw .de-form-table .de-form-tr:has(textarea) > .de-form-th {
        float: none !important;
        flex: 0 0 193px;
        width: 193px !important;
        height: auto !important;
        min-height: 210px;
        display: flex;
        align-items: center;
        line-height: 1.5 !important;
    }

    .formw .de-form-table .de-form-tr:has(textarea) > .de-form-td {
        float: none !important;
        flex: 1 1 auto;
        width: auto !important;
        height: auto !important;
        min-height: 210px;
    }
}
