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

:root{
  --cream:#f2f0e3;
  --green:#3c605e;
  --text:#616161;
  --field:#cdd5ca;
  --pale:#dfe5d8;
  --brown:#91743F;
  --footerText:#EFEBDF;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  background:var(--cream);
  font-family:"Noto Sans TC","Microsoft JhengHei",Arial,sans-serif;
  color:#333;
  line-height:1.75;
}
a{text-decoration:none;color:inherit}
img{display:block;max-width:100%}

.page{
  width:100%;
  margin:0;
  background:var(--cream);
  overflow:hidden;
}

/* ===== desktop contact ===== */
.contact-hero{
  height:318px;
  background:url('https://yi-tian.tw/assets/contact/banner.png') center/cover no-repeat;
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--cream);
}
.contact-hero:before{
  content:"";
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.08);
}
.contact-hero-title{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:26px;
  text-shadow:0 3px 10px rgba(0,0,0,.35);
  color:var(--cream);
}
.contact-hero-title h1{
  margin:0;
  font-size:39px;
  letter-spacing:.32em;
  line-height:1;
  font-weight:500;
  color:var(--cream);
}
.contact-hero-title span{
  font-size:32px;
  letter-spacing:.10em;
  line-height:1;
  font-family:Afacad,Arial,sans-serif;
  font-weight:400;
  color:var(--cream);
}

.contact-main{
  background:var(--cream);
  position:relative;
  padding:68px 30px 0;
}
.contact-inner{
  max-width:1080px;
  margin:0 auto;
  position:relative;
  z-index:1;
}
.section-heading{
  text-align:center;
  color:var(--green);
  margin:0 0 24px;
}
.section-heading h2{
  margin:0;
  font-size:42px;
  letter-spacing:.35em;
  line-height:1;
  font-weight:600;
  color:var(--green);
}
.section-heading span{
  display:block;
  margin-top:17px;
  font-size:31px;
  letter-spacing:.16em;
  font-family:Afacad,Arial,sans-serif;
  line-height:1;
  font-weight:400;
  color:var(--green);
}
.contact-copy{
  max-width:720px;
  margin:0 auto 34px;
  text-align:justify;
  color:#616161;
  font-size:16px;
  line-height:2.05;
  letter-spacing:.06em;
  font-weight:700;
}
.form-wrap{
  max-width:700px;
  margin:0 auto;
}
.form-row{
  display:grid;
  grid-template-columns:72px 1fr 50px 1fr;
  align-items:center;
  gap:14px;
  margin-bottom:18px;
}
.form-line{
  display:grid;
  grid-template-columns:72px 1fr;
  align-items:center;
  gap:14px;
  margin-bottom:18px;
}
.form-label{
  color:var(--green);
  font-size:16px;
  letter-spacing:.05em;
  font-weight:500;
  white-space:nowrap;
}
.field{
  width:100%;
  height:32px;
  border:0;
  border-radius:18px;
  background:var(--field);
  padding:0 16px;
  color:#3C605E;
  font-family:"Noto Sans TC","Microsoft JhengHei",Arial,sans-serif;
  font-size:14px;
  letter-spacing:0;
  outline:none;
}
.field option{
  font-family:"Noto Sans TC","Microsoft JhengHei",Arial,sans-serif;
  color:#3C605E;
  font-size:14px;
  letter-spacing:0;
}
.textarea{
  height:176px;
  border-radius:14px;
  padding:14px 16px;
  resize:none;
}
.form-actions{
  display:block;
  align-items:center;
  justify-content:space-between;
  margin:30px 0 58px;
  padding-left:72px;
  text-align:justify;
  text-align-last:right;
}
.reset-btn{
  border:0;
  background:transparent;
  color:#3C605E;
  font-size:16px;
  letter-spacing:.08em;
  cursor:pointer;
  font-weight:700;
}
.reset-btn:hover{color:#91743F}
.submit-btn{
  width:170px;
  height:51px;
  border:0;
  background:url('https://yi-tian.tw/assets/contact/submit.png') center/contain no-repeat;
  cursor:pointer;
  color:transparent;
  transition:.25s;
}
.submit-btn:hover{
  background-image:url('https://yi-tian.tw/assets/contact/submit-hover.png');
  transform:translateX(2px);
}

.contact-icons{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:26px;
  max-width:860px;
  margin:0 auto 22px;
}
.contact-icon-card{
  border:0;
  background:transparent;
  box-shadow:none;
  padding:0;
  margin:0;
  display:block;
  cursor:pointer;
  transition:.25s;
}
.contact-icon-card:hover{transform:translateY(-6px)}
.contact-icon-card img{
  width:100%;
  height:auto;
  display:block;
}

.map-area{
  position:relative;
  margin:0 auto 0;
  max-width:1080px;
}
.map-link{
  display:block;
  position:relative;
  overflow:hidden;
  border-radius:15px;
  margin-bottom:20px;
}
.map-link>img:not(.map-card){
  width:100%;
  height:236px;
  object-fit:cover;
  filter:saturate(.8);
  opacity:.88;
}
.map-card{
  position:absolute!important;
  left:32px;
  top:25px;
  width:230px!important;
  height:auto!important;
  object-fit:contain!important;
  filter:drop-shadow(0 5px 10px rgba(0,0,0,.18));
  opacity:1!important;
  z-index:2;
}

/* contact page modal for phone / fax / mail cards */
.contact-modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:100;
  opacity:0;
  pointer-events:none;
  transition:.25s;
}
.contact-modal.show{
  opacity:1;
  pointer-events:auto;
}
.contact-modal img{
  width:min(360px,82vw);
  box-shadow:0 14px 35px rgba(0,0,0,.25);
}

/* ===== tablet ===== */
@media(max-width:900px){
  .contact-hero{height:220px}
  .contact-hero-title{
    gap:12px;
    flex-wrap:wrap;
  }
  .contact-hero-title h1{font-size:30px}
  .contact-hero-title span{font-size:24px}
  .section-heading h2{font-size:32px}
  .section-heading span{font-size:24px}
  .contact-main{padding:48px 22px 0}
  .form-row{grid-template-columns:1fr;gap:7px}
  .form-line{grid-template-columns:1fr;gap:7px}
  .form-actions{
    padding-left:0;
    margin-top:26px;
  }
  .contact-icons{
    grid-template-columns:repeat(2,1fr);
    gap:18px;
  }
  .map-card{
    width:190px;
    left:18px;
    top:18px;
  }
}

/* ===== mobile contact exact ===== */
@media(max-width:520px){
  html,body{
    background:#f2f0e3;
    overflow-x:hidden;
  }

  .page{
    width:100%;
    min-width:0;
    background:#f2f0e3;
    overflow:hidden;
  }

  .contact-hero{
    height:142px;
    background:url('https://yi-tian.tw/assets/mobile-contact/mobile-banner.svg') center/cover no-repeat!important;
    margin:0;
    padding:0;
  }

  .contact-hero:before,
  .contact-hero-title{
    display:none!important;
  }

  .contact-main{
    padding:33px 0 0;
    background:#f2f0e3;
  }

  .contact-inner{
    width:100%;
    max-width:393px;
    margin:0 auto;
  }

  .section-heading{
    margin:0 auto 20px;
    text-align:center;
    color:#3c605e;
  }

  .section-heading h2{
    font-size:31px;
    letter-spacing:.34em;
    line-height:1;
    margin:0 0 10px;
    padding-left:.34em;
    font-weight:800;
  }

  .section-heading span{
    font-size:17px;
    letter-spacing:.15em;
    line-height:1;
    font-family:Afacad,Arial,sans-serif;
    margin:0;
  }

  .contact-copy{
    width:318px;
    margin:0 auto 33px;
    text-align:justify;
    color:#616161;
    font-size:13px;
    line-height:2.08;
    letter-spacing:.055em;
    font-weight:700;
  }

  .form-wrap{
    width:320px;
    margin:0 auto 62px;
  }

  .form-row{
    display:grid!important;
    grid-template-columns:57px 100px 26px 100px!important;
    column-gap:11px;
    align-items:center;
    margin-bottom:18px;
  }

  .form-row .form-label:nth-child(1){
    grid-column:1;
    grid-row:1;
    text-align:right;
  }

  .form-row .field:nth-child(2){
    grid-column:2;
    grid-row:1;
  }

  .form-row .form-label:nth-child(3){
    grid-column:3;
    grid-row:1;
  }

  .form-row .field:nth-child(4){
    grid-column:4;
    grid-row:1;
  }

  .form-line{
    display:grid!important;
    grid-template-columns:56px 1fr!important;
    column-gap:12px;
    align-items:center;
    margin-bottom:18px;
  }

  .form-line:has(.textarea){
    align-items:start;
  }

  .form-label{
    font-size:12px;
    color:#3c605e;
    font-weight:700;
    letter-spacing:.08em;
    line-height:1;
    white-space:nowrap;
  }

  .field{
    height:30px;
    border:0;
    border-radius:999px;
    background:#cdd5ca;
    color:#355d5b;
    padding:0 10px;
    font-size:12px;
    outline:none;
    box-shadow:none;
  }

  select.field{
    appearance:none;
    -webkit-appearance:none;
    background:#cdd5ca;
    color:#355d5b;
    font-size:12px;
  }

  .textarea{
    height:126px;
    border-radius:9px;
    padding:8px 10px;
    resize:none;
  }

  .form-actions{
    display:flex;
    margin:19px 0 0;
    padding-left:56px;
    align-items:center;
    justify-content:space-between;
  }

  .reset-btn{
    width:auto;
    height:auto;
    background:none;
    border:0;
    color:#3c605e;
    font-size:12px;
    letter-spacing:.08em;
    font-weight:700;
    padding:0;
  }

  .submit-btn{
    width:83px;
    height:24px;
    background:url('https://yi-tian.tw/assets/mobile-contact/mobile-submit.png') center/contain no-repeat;
    border:0;
    color:transparent;
    font-size:0;
    padding:0;
    margin:0;
  }

  .submit-btn:hover{
    background-image:url('https://yi-tian.tw/assets/mobile-contact/mobile-submit-hover.png');
    transform:none;
  }

  .contact-icons{
    display:grid;
    grid-template-columns:repeat(2,140px);
    justify-content:center;
    gap:0px 10px;
    max-width:430px;
    margin:0 auto 38px;
  }

  .contact-icon-card{
    width:150px;
    height:auto;
    background:transparent;
    box-shadow:none;
    border-radius:0;
  }

  .contact-icon-card:hover{
    transform:translateY(-2px);
  }

  .contact-icon-card img{
    width:150px;
    height:auto;
  }

  .map-area{
    width:100%;
    max-width:393px;
    margin:0 auto;
  }

  .map-link{
    border-radius:0;
    display:block;
    margin:0;
  }

  .map-link>img:first-child{
    height:130px;
    width:100%;
    object-fit:cover;
    opacity:1;
    filter:none;
  }

  .map-card{
    display:none;
  }

  .contact-modal img{
    width:82vw;
    max-width:320px;
  }
}

@media(max-width:370px){
  .form-wrap{width:280px}
  .form-row{
    grid-template-columns:31px 84px 31px 84px!important;
    column-gap:9px;
  }
  .contact-icons{
    grid-template-columns:repeat(2,132px);
    gap:18px 18px;
  }
  .contact-icon-card,
  .contact-icon-card img{
    width:132px;
  }
}

/* 自訂性別下拉選單 */
.custom-select{
  position:relative;
  width:100%;
  z-index:20;
}

.custom-select-btn{
  width:100%;
  height:32px;
  border:0;
  border-radius:18px;
  background:#cdd5ca;
  color:#3c605e;
  font-size:14px;
  letter-spacing:.08em;
  padding:0 42px 0 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  cursor:pointer;
  box-shadow:0 4px 7px rgba(0,0,0,.18);
  font-family:"Noto Sans TC","Microsoft JhengHei",Arial,sans-serif;
}

.custom-select-arrow{
  position:absolute;
  right:12px;
  top:54%;
  transform:translateY(-54%);
  width:28px;
  font-size:28px;
  line-height:1;
  color:#3c605e;
  pointer-events:none;
}

.custom-select-options{
  position:absolute;
  left:0;
  top:38px;
  width:100%;
  background:#cdd5ca;
  border-radius:16px;
  padding:8px;
  box-shadow:0 6px 10px rgba(0,0,0,.22);
  display:none;
  z-index:99;
}

.custom-select.open .custom-select-options{
  display:block;
}

.custom-select-options button{
  width:100%;
  border:0;
  background:transparent;
  color:#3c605e;
  font-size:16px;
  letter-spacing:.08em;
  text-align:left;
  padding:5px 12px;
  border-radius:8px;
  cursor:pointer;
  font-family:"Noto Sans TC","Microsoft JhengHei",Arial,sans-serif;
}

.custom-select-options button:hover,
.custom-select-options button.active{
  background:#aebeb3;
}

.d-hide{
  display:none;
}
.m-hide{
  display:block;
}

@media(max-width:520px){
  .d-hide{
    display:block;
  }
  .m-hide{
    display:none!important;
  }
  .custom-select-btn{
    height:30px;
    font-size:9px;
  }
}

/* ===== Contact captcha desktop + mobile ===== */
.captcha-line{
  display:grid;
  grid-template-columns:72px 170px 120px;
  align-items:center;
  gap:22px;
  margin:34px 0 0;
}

.captcha-input{
  width:100%;
  height:32px;
  border:0;
  border-radius:18px;
  background:#fff;
  padding:0 16px;
  color:#3C605E;
  font-size:15px;
  letter-spacing:.08em;
  outline:none;
  box-shadow:0 4px 7px rgba(0,0,0,.16);
}

.captcha-code{
  height:32px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#eef3fb;
  color:#333;
  font-family:Arial, sans-serif;
  font-size:22px;
  font-weight:700;
  letter-spacing:.22em;
  user-select:none;
}

.captcha-refresh{
  border:0;
  background:transparent;
  color:#3C605E;
  font-size:16px;
  letter-spacing:.08em;
  cursor:pointer;
  font-weight:700;
  padding:0;
}

.captcha-refresh:hover{
  color:#91743F;
}

@media(max-width:520px){
  .captcha-line{
    display:grid !important;
    grid-template-columns:56px 92px 72px !important;
    align-items:center !important;
    column-gap:12px !important;
    margin:24px 0 0 !important;
  }

  .captcha-line .form-label{
    grid-column:1;
    grid-row:1;
  }

  .captcha-input{
    grid-column:2;
    grid-row:1;
    height:24px !important;
    border-radius:999px !important;
    padding:0 8px !important;
    font-size:12px !important;
    background:#fff !important;
    box-shadow:0 3px 5px rgba(0,0,0,.16) !important;
  }

  .captcha-code{
    grid-column:3;
    grid-row:1;
    height:24px !important;
    font-size:14px !important;
    letter-spacing:.18em !important;
    background:#eef3fb !important;
  }

  .form-actions{
    display:grid !important;
    grid-template-columns:56px 1fr 83px !important;
    align-items:center !important;
    column-gap:12px !important;
    margin:22px 0 0 !important;
    padding-left:0 !important;
  }

  .reset-btn{
    grid-column:2 !important;
    justify-self:center !important;
    font-size:12px !important;
    letter-spacing:.08em !important;
    color:#3c605e !important;
  }

  .submit-btn{
    grid-column:3 !important;
    justify-self:end !important;
    width:83px !important;
    height:24px !important;
  }
}
