#contact_form {
    box-sizing: border-box;
    height: auto;
    text-align: center;
    border: none;
    margin: 20px auto;
    width: 760px;
    animation: 1s fadeup ease-in-out forwards;
    font-size: 15px;
    box-sizing: border-box;
    padding: 30px;
    background-color: #ffff;
    box-shadow: 0 10px 25px 0 #cbcbcb;
    border-radius: 20px;
}

#contact_title {
    font-weight: 700;
    font-size: 25px;
}

.red {
    color: red;
    font-size: 12px;
}

#subject_choices {
    margin: 20px 0;
}

#subject_choices > div > p {
    text-align: left;
}

.subject_row {
    display: flex;
    justify-content: center;
    margin: 10px 0;
}

input[type=radio] {
    display: none;
}

label[for^="subject"] {
    height: auto;
    width: 150px;
    margin: 0 15px;
    padding: 10px;
    line-height: 1.4;
    display: inline-block;
    background-color: #eeeeee;
    border-radius: 15px;
    transition: .3s;
    text-align: center;
    align-content: center;
    word-break: break-word;
    white-space: normal;
}

label[for^="subject"]:hover {
    background-color: rgb(252, 221, 227);
}

input[type=radio]:checked + label {
    background-color: rgb(252, 221, 227);
}

#contact_form > div:first-of-type > div:nth-of-type(2),
#contact_form > div:first-of-type > div:nth-of-type(3),
#confirmation_area > div:nth-of-type(2),
#confirmation_area > div:nth-of-type(3) {
    display: flex;
    text-align: left;
}

input[name="questioner_name"] {
    width: 500px;
    height: 30px;
    margin: auto 0 auto 0px;
}

input[name="mail_address"] {
    width: 500px;
    height: 30px;
    margin: auto 0 auto 0px;
}

#contact_form > div:first-of-type > div:nth-of-type(4) {
    text-align: start;
}

textarea {
    width: 100%;
    height: 200px;
    resize: vertical;
}

#contact_form div:nth-of-type(5) {
    margin: 12px;
}

.massage {
    color: red;
}

#back_edit_bt,
#submit_bt {
    width: 90px;
    height: 38px;
    line-height: 40px;
    font-weight: 700;
    background-color: pink;
    color: #ffff;
    margin: 30px auto;
    border-radius: 20px;
    cursor: pointer;
    transition: .3s;
    border: 4px solid pink;
}

#back_edit_bt:hover,
#submit_bt:hover {
    color: pink;
    border: 4px solid pink;
    background-color: #ffff;
}

#confirmation_area {
    display: none;
    animation: 1s fadeup ease-in-out forwards;
}

#confirmation_area > div {
    border-bottom: 1px solid #3333;
}

#confirmation_area > div > p {
    width: 120px;
    text-align: end;
    padding-left: 10px;
}
#confirmation_area > span:first-of-type {
    font-size: 18px;
    margin: 18px;
    display: block;
}

#confirmation_area > div span {
    margin: 15px auto;
    white-space: pre-wrap;
    font-size: 15px;
    text-align: start;
}
#confirmation_area > div:first-of-type,
#confirmation_area > div:nth-of-type(4) {
    display: flex;
}

div:has(#back_edit_bt) {
    display: flex;
}

#back_edit_bt {
    display: none;
    width: 150px;
}


#close_button {
	font-size: 25px;
	position: absolute;   /* ページ右上に固定したい場合 */
	top: 30px;
	right: 60px;
}

.close_link {
  position: relative;
  text-decoration: none;
  display: inline-block;
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  border: 1px solid #333;
  border-radius: 50%;
  color: #333;
  font-size: 20px;
  cursor: pointer;
}

/* ツールチップ部分 */
.close_link::after {
  content: "ホームに戻る";
  position: absolute;
  top: -30px;       /* ボタンの上に表示 */
  left: 50%;
  transform: translateX(-50%);
  background: #666;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 16px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

/* hover時に表示 */
.close_link:hover::after {
  opacity: 1;
}



@keyframes fadeup {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/*以下スマホ用css*/
@media(max-width:620px){
    #contact_form {
        width: 90%;
        margin: 38px 17px 20px;
    }
    label[for^="subject"] {
        height: 50px;
        line-height: 1em;
        margin: 5px 5px;
        padding: 5px;
    }
    #contact_form > div:first-of-type > div:nth-of-type(2), 
    #contact_form > div:first-of-type > div:nth-of-type(3) {
        display: block;
    }
    input[name="questioner_name"],
    input[name="mail_address"] {
        width: 93%;
        margin: 0 5px;
    }
    p {
        margin: 0;
    }
    #confirmation_area > div:first-of-type, 
    #confirmation_area > div:nth-of-type(2), 
    #confirmation_area > div:nth-of-type(3),
    #confirmation_area > div:nth-of-type(4) {
        display: block;
        text-align: center;
    }
    #confirmation_area > div > span {
        text-align: center;
    }
    #confirmation_area > div > p {
        text-align: start;
    }
}