body {
    font-family: "Yu Gothic", "YuGothic", "游ゴシック体", "Hiragino Sans", "Meiryo", sans-serif;
    background-color: #fff;
}

/* コンテナ */
.container {
    max-width: 40%;
    margin: 0 auto;
    padding: 0px 20px 40px 20px;
    padding-bottom: 120px;
}

.contact-header {
    text-align: center;
    padding: 50px 0 0px;
    flex-shrink: 0;
}

#contact-h1{
        max-width: 50%;
        margin-top: 12%;
      }

/* ページタイトル */
.page-title {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

/* フォーム説明文 */
.form-description {
    margin-bottom: 40px;
    font-size: 14px;
    line-height: 1.8;
    FONT-WEIGHT: 600;
}

.form-description p {
    margin-bottom: 8px;
}

/* フォーム全体 */
.contact-form {
    width: 100%;
}

/* フォームグループ */
.form-group {
    margin-bottom: 60px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #ccc;
    padding-bottom: 12px;
    transition: border-color 0.3s;
}

.form-group:focus-within {
    border-bottom-color: #333;
}

/* ラベル */
.form-group label {
    font-size: 14px;
    color: #333;
    min-width: 140px;
    flex-shrink: 0;
    white-space: nowrap;
    padding-right: 20px;
    font-weight: 600;
}

/* 必須マーク */
.required {
    background-color: #ffd800;
    color: #333;
    font-size: 11px;
    padding: 0px 6px;
    border-radius: 0px;
    margin-left: 8px;
    font-weight: 600;
}

/* 入力フィールド共通 */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea {
    flex: 1;
    padding: 0;
    font-size: 14px;
    border: none;
    background-color: transparent;
    font-family: inherit;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="tel"]:focus,
.form-group textarea:focus {
    outline: none;
}

/* テキストエリア */
.form-group textarea {
    resize: vertical;
    min-height: 150px;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 15px;
}

.form-group textarea:focus {
    border-color: #333;
}

/* 備考フィールドは縦並び */
.form-group.message-group {
    flex-direction: column;
    align-items: flex-start;
    border-bottom: none;
    padding-bottom: 0;
}

.form-group.message-group label {
    margin-bottom: 8px;
    padding-right: 0;
}

.form-group.message-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #999;
    border-radius: 0;
}

/* カスタムセレクトボックス */
.custom-select-wrapper {
    position: relative;
    flex: 1;
}

/* セレクトを含むform-groupも統一下線 */
.form-group:has(.custom-select-wrapper) {
    padding-bottom: 12px;
    border-bottom: 1px solid #ccc;
}

.form-group:has(.custom-select-wrapper):focus-within {
    border-bottom-color: #333;
}

.custom-select {
    position: relative;
    width: 100%;
    user-select: none;
}

.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    border: none;
    cursor: pointer;
    transition: border-color 0.3s;
}

.custom-select-trigger span {
    font-size: 18px;
    font-weight:600;
    color: #333;
}

.arrow-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
    color: #666;
}

.custom-select.open .arrow-icon {
    transform: rotate(180deg);
}

.custom-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    max-height: 280px;
    overflow-y: auto;
}

.custom-select.open .custom-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease;
    position: relative;
}

.custom-option:hover {
    background-color: #f5f5f5;
    padding-left: 20px;
}

.custom-option.selected {
background-color: #e4f7f7;
    color: #54c0c0;
    font-weight: 500;
}

.custom-option.selected::before {
    content: '✓';
    position: absolute;
    left: 16px;
    opacity: 0;
    transition: opacity 0.2s;
}

.custom-option.selected:hover::before {
    opacity: 1;
}

/* スクロールバーのスタイリング */
.custom-options::-webkit-scrollbar {
    width: 6px;
}

.custom-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.custom-options::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.custom-options::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* チェックボックスグループ */
.checkbox-group {
    margin-top: 30px;
    justify-content: flex-start;
    border-bottom: none;
    padding-bottom: 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* 送信ボタンラッパー - 左揃え（強制） */
.submit-wrapper {
    margin-top: 40px;
    text-align: left !important;
    display: block !important;
    margin-left: 0 !important;
    margin-right: auto !important;
}

/* 送信ボタン */
.submit-button {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    display: inline-block !important;
    margin: 0 !important;
    float: none !important;
}

.submit-button:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.submit-button:active {
    transform: scale(0.98);
}

@media (min-width: 768px) {
    .submit-image {
        width: 65%;
    }
}

/* 成功メッセージ */
.success-message {
    border: 2px solid #54c0c0;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
}

.success-message p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.success-message a {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 30px;
    background-color: #54c0c0;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.success-message a:hover {
    background-color: #e4f7f7;
}

/* エラーメッセージ */
.error-messages {
    background-color: #ffebee;
    border: 2px solid #f44336;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.error-messages ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.error-messages li {
    color: #c62828;
    padding: 8px 0;
    border-bottom: 1px solid #ffcdd2;
}

.error-messages li:last-child {
    border-bottom: none;
}

.error-messages li:before {
    content: '⚠ ';
    margin-right: 8px;
}

/* レスポンシブデザイン - スマートフォン */
@media (max-width: 768px) {
    .container {
        max-width: 90%;
        padding: 30px 16px;
        padding-top:0px;
    }

    #contact-h1{
        max-width: 80%;
        margin-top: 20%;
      }

    .form-group.message-group textarea {
        width: 92%;
    }

    img.submit-image {
        width: 100% !important;
    }

    .page-title {
        font-size: 18px;
        margin-bottom: 30px;
        font-weight:600;
    }

    .form-description {
        font-size: 13px;
        margin-bottom: 30px;
    }

    .form-group {
        margin-bottom: 25px;
        flex-direction: column;
        align-items: flex-start;
        border-bottom: none;
        padding-bottom: 0;
    }

    .form-group label {
        font-size: 13px;
        min-width: auto;
        margin-bottom: 8px;
        padding-right: 0;
    }

    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="tel"],
    .form-group textarea {
        font-size: 16px; /* iOSのズームを防ぐ */
        width: 100%;
        padding: 12px 0;
        border-bottom: 1px solid #ccc;
    }

    .form-group input[type="text"]:focus,
    .form-group input[type="email"]:focus,
    .form-group input[type="tel"]:focus {
        border-bottom-color: #333;
    }

    .custom-select-wrapper {
        width: 100%;
    }

    .form-group:has(.custom-select-wrapper) {
        padding-bottom: 0;
        border-bottom: none;
    }

    .custom-select-wrapper {
        border-bottom: 1px solid #ccc;
        padding-bottom: 12px;
    }

    .submit-button {
        width: 100%;
    }
}

/* タブレット */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 50%;
    }
}

/* 備考フィールドのプレースホルダー */
.form-group.message-group textarea::placeholder {
    color: #333;           /* 文字色 */
    font-weight: 600;      /* 太字 */
    opacity: 1;            /* 不透明度100% */
}