/* 
* Bean Contact Form
* 깔끔한 비즈니스 스타일 폼 디자인
*/

/* Form Base */
.bean_contact_form,
.ap_form {
  color: #333333;
  background-color: #ffffff;
  padding: 2em;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  max-width: 800px;
  margin: 0 auto;
  border: 1px solid #eaeaea;
}

.ap_form::after {
  clear: both;
  content: '';
  display: table;
}

.ap_form *,
.ap_form *::after,
.ap_form *::before {
  box-sizing: border-box;
}

/* Fieldsets */
.ap_form fieldset {
  margin: 24px 0;
  padding: 0;
  border: 0;
}

.ap_form fieldset:first-of-type {
  margin-top: 0;
}

.ap_form fieldset:last-of-type {
  margin: 0;
}

/* Legends */
.ap_form legend {
  margin-bottom: 20px;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  border-bottom: 1px solid #eaeaea;
  width: 100%;
  padding-bottom: 8px;
}

/* Form Items */
.ap_form fieldset > div {
  position: relative;
  margin: 24px 0;
}

.ap_form legend + div {
  margin-top: 16px;
}

/* Labels */
.ap_form label,
.ap_form h4 {
  font-size: 14px;
  font-weight: 500;
  color: #555;
}

.ap_form h4 {
  margin: 0;
}

.ap_form h4 + div {
  margin: 2px 0 20px;
}

/* Form Controls */
.ap_form input,
.ap_form select,
.ap_form textarea {
  font-size: 14px;
  color: #333;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ap_form input[type="text"],
.ap_form input[type="url"],
.ap_form input[type="email"],
.ap_form input[type="tel"],
.ap_form input[type="number"],
.ap_form input[type="password"],
.ap_form select,
.ap_form textarea,
.ap_form legend {
  display: block;
  width: 100%;
  appearance: none;
}

.ap_form input[type="text"],
.ap_form input[type="url"],
.ap_form input[type="email"],
.ap_form input[type="tel"],
.ap_form input[type="number"],
.ap_form input[type="password"],
.ap_form select,
.ap_form textarea {
  padding: 10px 12px;
  border: 1px solid #ddd;
  background-color: #ffffff;
  line-height: 1.5;
}

.ap_form input[type="text"]:focus,
.ap_form input[type="url"]:focus,
.ap_form input[type="email"]:focus,
.ap_form input[type="tel"]:focus,
.ap_form input[type="number"]:focus,
.ap_form input[type="password"]:focus,
.ap_form select:focus,
.ap_form textarea:focus {
  outline: none;
  border-color: #0078d7;
  box-shadow: 0 0 0 2px rgba(0, 120, 215, 0.1);
}

/* Select */
.ap_form select {
  cursor: pointer;
}

/* Textarea */
.ap_form textarea {
  min-height: 150px;
  resize: vertical;
  overflow: auto;
}

/* Radio & Checkbox */
.ap_form input[type=radio],
.ap_form input[type=checkbox] {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 0;
  opacity: 0;
  z-index: 2;
}

.ap_form input[type=radio]+label,
.ap_form input[type=checkbox]+label {
  position: relative;
  top: 0;
  left: 0 !important;
  padding-left: 24px;
  cursor: pointer;
}

.ap_form input[type=radio]+label::before,
.ap_form input[type=radio]+label::after,
.ap_form input[type=checkbox]+label::before,
.ap_form input[type=checkbox]+label::after {
  content: '';
  display: block;
  position: absolute;
  left: 0;
  top: 50%;
  margin-top: -8px;
  width: 16px;
  height: 16px;
}

.ap_form input[type=radio]+label::before,
.ap_form input[type=checkbox]+label::before {
  border: 1px solid #ddd;
  background: #fff;
}

.ap_form input[type=radio]+label::before,
.ap_form input[type=radio]+label::after {
  border-radius: 50%;
}

.ap_form input[type=radio]+label::after,
.ap_form input[type=checkbox]+label::after {
  background-color: #0078d7;
  background-position: center center;
  background-repeat: no-repeat;
  display: none;
}

.ap_form input[type=radio]:checked+label::after,
.ap_form input[type=checkbox]:checked+label::after {
  display: block;
}

/* Lists */
.ap_form ul {
  margin: 0;
  padding: 8px 0 0;
  min-height: 50px;
  list-style: none;
}

.ap_form ul li {
  position: relative;
  display: inline-block;
  user-select: none;
  margin: 8px 26px 4px 0;
}

.ap_form .ap_extra p {
  margin: 4px 0;
  text-align: left;
  font-size: 13px;
}

/* Submit Section */
.ap_form .ap_submit_info {
  position: relative;
  min-height: 36px;
  line-height: 2;
}

.ap_form .ap_submit_info::after {
  content: '';
  display: table;
  clear: both;
}

.ap_form .ap_submit_info .ap_section {
  display: inline-block;
  margin: 0 32px 0 0 !important;
}

.ap_form .ap_submit_info ul.ap_section {
  margin-bottom: 16px !important;
  padding: 0;
  min-height: auto;
  white-space: nowrap;
}

.ap_form .ap_submit_info ul.ap_section li {
  margin: 0 12px 0 0;
}

/* Submit Button */
.ap_form .ap_submit_info input[type="submit"] {
  border: none;
  background: #0078d7;
  padding: 10px 20px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  float: right;
  appearance: none;
  transition: background 0.3s;
}

.ap_form .ap_submit_info input[type="submit"]:hover {
  background: #0063b1;
}

.ap_form .ap_submit_info input[type="submit"]:focus {
  outline: none;
  background: #0063b1;
}

.ap_form .ap_submit_info input[type="submit"]:active {
  transform: scale(0.98);
}

/* Password Field */
.ap_form .ap_message[rel="password"] {
  display: table;
  margin: 32px auto !important;
}

/* Extra Keys Info */
.ap_form .ap_extra[rel="tel"] {
  text-align: center;
  clear: both;
}

.ap_form .ap_extra[rel="tel"]:after {
  content: '';
  display: table;
  clear: both;
}

.ap_form .ap_extra[rel="tel"] input.tel {
  display: inline-block;
  padding-left: 12px !important;
  width: calc(33.1% - 18px);
}

.ap_form .ap_extra[rel="tel"] input.tel:nth-child(1) {
  margin-left: 54px;
  float: left;
}

.ap_form .ap_extra[rel="tel"] input.tel:nth-child(3) {
  float: right;
}

/* Select Controls */
.ap_form .ap_extra[rel="select"]::after,
.ap_form .ap_message[rel="category"]::after {
  content: '';
  position: absolute;
  z-index: 1;
  right: 16px;
  top: 50%;
  margin-top: -4px;
  display: block;
  width: 8px;
  height: 8px;
  border: solid #555;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  pointer-events: none;
}

/* Disabled elements */
.ap_form input:disabled,
.ap_form select:disabled,
.ap_form textarea:disabled {
  background-color: #f8f8f8 !important;
  border-color: #eaeaea;
  color: #888;
  cursor: not-allowed;
}

/* Privacy Section */
.ap_form .ap_submit_info .ap_privacy,
.ap_form .ap_submit_info .ap_privacy li {
  display: block;
}

.ap_form .ap_submit_info .ap_privacy .ap_popup_trigger {
  font-size: 12px;
  color: #0078d7;
  text-decoration: none;
}

.ap_form .ap_submit_info .ap_privacy .ap_popup_trigger:hover {
  text-decoration: underline;
}

.ap_form .ap_submit_info .ap_privacy .ap_privacy_content {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 100%;
  max-width: 800px;
  height: 100%;
  max-height: 600px;
  padding: 24px;
  background-color: #ffffff;
  box-shadow: 0 5px 30px rgba(0,0,0,.15);
  opacity: 0;
  visibility: hidden;
  white-space: normal;
  transform: translate(-50%, -50%);
  transition: opacity .3s, visibility 0s .3s;
  z-index: 9999;
}

.ap_form .ap_submit_info .ap_privacy .ap_privacy_content.is_visible {
  opacity: 1;
  visibility: visible;
  transition: opacity .3s, visibility 0s 0s;
}

.ap_form .ap_submit_info .ap_privacy .ap_privacy_title_container {
  position: relative;
  height: 32px;
  margin-bottom: 16px;
}

.ap_form .ap_submit_info .ap_privacy .ap_privacy_title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.ap_form .ap_submit_info .ap_privacy .ap_popup_close {
  position: absolute;
  right: 0;
  top: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  text-decoration: none;
}

.ap_form .ap_submit_info .ap_privacy .ap_popup_close::before,
.ap_form .ap_submit_info .ap_privacy .ap_popup_close::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 2px;
  background-color: #666;
}

.ap_form .ap_submit_info .ap_privacy .ap_popup_close::before {
  transform: rotate(45deg);
}

.ap_form .ap_submit_info .ap_privacy .ap_popup_close::after {
  transform: rotate(-45deg);
}

.ap_form .ap_submit_info .ap_privacy .ap_privacy_desc {
  position: relative;
  width: 100%;
  height: calc(100% - 80px);
  padding: 20px;
  overflow: auto;
  background: #fff;
  border: 1px solid #eaeaea;
  font-size: 14px;
  line-height: 1.6;
}

.ap_form .ap_submit_info .ap_privacy .ap_privacy_command_container {
  position: relative;
  height: 28px;
  margin-top: 16px;
  text-align: right;
}

.ap_form .ap_submit_info .ap_privacy .ap_privacy_check,
.ap_form .ap_submit_info .ap_privacy .ap_privacy_check + label::before,
.ap_form .ap_submit_info .ap_privacy .ap_privacy_check + label::after {
  right: 0;
  left: auto;
}

.ap_form .ap_submit_info .ap_privacy .ap_privacy_check + label {
  padding-right: 24px;
  padding-left: 0;
  color: #333;
}

/* Icon Inputs */
.ap_form .ap_item input,
.ap_form .ap_item select,
.ap_form .ap_item textarea {
  padding-left: 40px !important;
}

/* Form Icons */
.ap_form .ap_basic input[name="nick_name"],
.ap_form .ap_basic input[name="nick_name"][required] {
  background: url("../img/ap_icon-user.svg") no-repeat 12px center / 18px;
}

.ap_form .ap_basic input[name="email_address"],
.ap_form .ap_basic input[name="email_address"][required] {
  background: url("../img/ap_icon-email.svg") no-repeat 12px center / 18px;
}

.ap_form .ap_basic input[name="phone_number"],
.ap_form .ap_basic input[name="phone_number"][required] {
  background: url("../img/ap_icon-phone.svg") no-repeat 12px center / 18px;
}

/* Form Message Icons */
.ap_form .ap_message input[name="title"],
.ap_form .ap_message input[name="title"][required] {
  background: url("../img/ap_icon-title.svg") no-repeat 12px center / 18px;
}

.ap_form .ap_message select[name="category"],
.ap_form .ap_message select[name="category"][required] {
  background: url("../img/ap_icon-category.svg") no-repeat 12px center / 18px;
}

.ap_form .ap_message textarea[name="message"],
.ap_form .ap_message textarea[name="message"][required] {
  background: url("../img/ap_icon-content.svg") no-repeat 12px 14px / 18px;
}

.ap_form .ap_message input[name="password"][required] {
  background: url("../img/ap_icon-password.svg") no-repeat 12px center / 18px;
}

/* Extra Icons */
.ap_form .ap_extra .text,
.ap_form .ap_extra .text[required] {
  background: url("../img/ap_icon-text.svg") no-repeat 12px center / 18px;
}

.ap_form .ap_extra[rel="homepage"] .homepage,
.ap_form .ap_extra[rel="homepage"].is_required .homepage {
  background: url("../img/ap_icon-homepage.svg") no-repeat 12px center / 18px;
}

.ap_form .ap_extra[rel="email_address"] .email_address,
.ap_form .ap_extra[rel="email_address"].is_required .email_address {
  background: url("../img/ap_icon-email.svg") no-repeat 12px center / 18px;
}

.ap_form .ap_extra[rel="tel"] {
  background: url("../img/ap_icon-phone.svg") no-repeat 12px 14px / 18px;
}

.ap_form .ap_extra[rel="textarea"] textarea,
.ap_form .ap_extra[rel="textarea"].is_required textarea {
  background: url("../img/ap_icon-content.svg") no-repeat 12px 14px / 18px;
}

.ap_form .ap_extra[rel="checkbox"] ul {
  padding-left: 40px !important;
  background: url("../img/ap_icon-checkbox.svg") no-repeat 12px 14px / 18px;
}

.ap_form .ap_extra[rel="select"] .select,
.ap_form .ap_extra[rel="select"].is_required .select {
  background: url("../img/ap_icon-select.svg") no-repeat 12px center / 18px;
}

.ap_form .ap_extra[rel="radio"] ul {
  padding-left: 40px !important;
  background: url("../img/ap_icon-radio_button.svg") no-repeat 12px 14px / 18px;
}

.ap_form .ap_extra[rel="date"] .date,
.ap_form .ap_extra[rel="date"].is_required .date {
  background: url("../img/ap_icon-date.svg") no-repeat 12px center / 18px;
}

.ap_form .ap_extra[rel="kr_zip"] .krZip {
  padding-left: 40px !important;
  background: url("../img/ap_icon-krzip.svg") no-repeat 12px 14px / 18px;
}

.ap_form .ap_extra[rel="password"] .password,
.ap_form .ap_extra[rel="password"].is_required .password {
  background: url("../img/ap_icon-hidden.svg") no-repeat 12px center / 18px;
}

/* Radio & Checkbox Icons */
.ap_form input[type=radio] + label::after {
  background-image: url("../img/ap_icon-radio.svg");
}

.ap_form input[type=checkbox] + label::after {
  background-image: url("../img/ap_icon-check.svg");
}

/* Required Fields */
.ap_form input[required],
.ap_form select[required],
.ap_form textarea[required],
.ap_form .is_required input,
.ap_form .is_required select,
.ap_form .is_required textarea,
.ap_form .is_required ul {
  background-position: 12px center, top right;
  background-size: 18px, 24px;
  background-repeat: no-repeat, no-repeat;
}

.ap_form .is_required ul {
  background-position: 12px 14px, top right;
}

/* FLoating labels */
.js .floating-labels label {
  position: absolute;
  top: 12px;
  left: 16px;
  font-size: 14px;
  cursor: text;
  transition: top 0.2s, left 0.2s, font-size 0.2s;
}

.js .floating-labels .ap_item label {
  left: 40px;
}

.js .floating-labels label.float {
  font-size: 12px;
  color: #0078d7;
  top: -20px;
  left: 0 !important;
}

/* Result Styling */
.ap_result {
  display: none;
  margin: 0 auto;
  width: 100%;
  max-width: 720px;
  font-size: 16px;
  color: #333;
}

.ap_result *,
.ap_result *::before,
.ap_result::after {
  box-sizing: border-box;
  border-collapse: collapse;
}

.ap_result header {
  display: block;
  margin: 0 auto;
  text-align: center;
  padding: 24px;
}

.ap_result header.is_blink {
  animation: blink .8s linear infinite;
}

.ap_result header::after {
  content: '';
  display: table;
  clear: both;
}

.ap_result .ap_image_wrapper {
  position: relative;
  display: inline-block;
  width: 200px;
  height: 120px;
  overflow: hidden;
  vertical-align: middle;
  background: url("../img/ap_send.gif") no-repeat center center;
  background-size: 200px;
}

.ap_result .ap_text_wrapper {
  position: relative;
  display: inline-block;
  height: 120px;
  text-align: left;
  vertical-align: middle;
}

.ap_result h3 {
  font-size: 18px;
  color: #333;
  margin-bottom: 8px;
}

.ap_result p {
  margin: 0;
  color: #666;
}

.ap_result a {
  color: #0078d7;
  text-decoration: none;
}

.ap_result a:hover {
  text-decoration: underline;
}

.ap_result section {
  display: block;
  margin: 32px auto;
}

.ap_result section:first-of-type {
  margin-top: 0;
}

.ap_result section:last-of-type {
  margin-bottom: 16px;
  padding-bottom: 32px;
  border-bottom: 1px solid #eaeaea;
}

.ap_result .ap_result_basic {
  display: table;
  margin: 4px 0;
}

.ap_result .ap_result_basic:first-child {
  display: block;
  padding: 24px 0;
  text-align: center;
}

.ap_result .ap_result_basic_th {
  display: table-cell;
  margin: 0;
  min-width: 120px;
  padding-right: 20px;
  font-weight: bold;
  text-align: right;
}

.ap_result .ap_result_basic:first-child .ap_result_basic_th {
  display: none;
}

.ap_result .ap_result_basic_td {
  display: table-cell;
  margin: 0;
}

.ap_result .ap_result_basic:first-child .ap_result_basic_td {
  display: block;
  width: 100%;
  padding: 24px;
  font-size: 24px;
  font-weight: 600;
  border-top: 1px solid #eaeaea;
  border-bottom: 1px solid #eaeaea;
}

.ap_result .ap_result_footer {
  margin: 0;
  text-align: right;
}

.ap_result .ap_result_footer a {
  position: relative;
  padding-right: 20px;
  font-size: 14px;
  font-weight: 500;
  background: url(../img/ap_icon-forward.svg) no-repeat center right / 16px;
}

/* Responsive Styles */
@media only screen and (min-width: 768px) {
  .ap_form {
    padding: 2.5em;
  }
  
  .ap_form legend {
    font-size: 18px;
  }
  
  .ap_form input,
  .ap_form select,
  .ap_form textarea,
  .ap_form label {
    font-size: 15px;
  }
  
  .js .floating-labels label {
    font-size: 15px;
  }
  
  .ap_form .ap_submit_info .ap_privacy .ap_privacy_content {
    width: 80%;
    height: 80%;
  }
}

/* Animation */
@keyframes blink {
  0% {
    background-color: transparent;
  }
  50% {
    background-color: rgba(0, 120, 215, 0.1);
  }
}
