/* デフォルト（ダークモード）のスタイル */
body {
    font-family: "M PLUS Rounded 1c", sans-serif;
    background-color: #111; /* ダークな背景 */
    color: #e0e0e0; /* 明るめのテキストカラー */
    margin: 0;
    padding: 0;
}

.main-section {
    max-width: 800px; /* フォームの最大幅 */
    margin: 1.5rem auto; /* 中央寄せ */
    padding: 30px;
    background-color: #1a1a1a; /* コンテナの背景色 */
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
}

h1 {
    font-size: 2.2rem;
    color: #1db954; /* サイトのアクセントカラー */
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 5px rgba(29, 185, 84, 0.3);
}

.message {
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    font-size: 0.95rem;
}

.success-message {
    background-color: #28a745; /* 緑系 */
    color: #fff;
    border: 1px solid #218838;
}

.error-message {
    background-color: #dc3545; /* 赤系 */
    color: #fff;
    border: 1px solid #c82333;
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #e0e0e0;
    font-size: 1rem;
}

.contact-form .required {
    color: #dc3545; /* 赤色で必須マーク */
    margin-left: 5px;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #555;
    border-radius: 8px;
    background-color: #2a2a2a; /* 入力フィールドの背景 */
    color: #e0e0e0;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-form input[type="text"]::placeholder,
.contact-form input[type="email"]::placeholder,
.contact-form textarea::placeholder {
    color: #888;
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
    border-color: #1db954; /* フォーカス時の色 */
    box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.3); /* フォーカス時のリング */
    outline: none;
    background-color: #333;
}

.contact-form textarea {
    resize: vertical; /* 垂直方向のみリサイズ可能に */
    min-height: 120px; /* 最小高さを設定 */
}

.submit-button {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: #1db954; /* サイトのアクセントカラー */
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(29, 185, 84, 0.4);
    margin-top: 25px;
}

.submit-button:hover {
    background-color: #1ed760; /* ホバー時の色 */
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(29, 185, 84, 0.5);
}

.recaptcha-notice {
    font-size: 0.85rem;
    color: #aaa;
    text-align: center;
    margin-top: 30px;
    line-height: 1.5;
}

.recaptcha-notice a {
    color: #00bcd4; /* リンクの色 */
    text-decoration: none;
    border-bottom: 1px solid #00bcd4;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.recaptcha-notice a:hover {
    color: #1ed760;
    border-color: #1ed760;
}

.back-link {
    text-align: center;
    margin-top: 30px;
}

.back-link a {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3a3a3a; /* ダークな背景 */
    color: #e0e0e0;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-size: 0.95rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.back-link a:hover {
    background-color: #555;
    transform: translateY(-1px);
}

/* --- ライトモードのスタイル --- */
@media (prefers-color-scheme: light) {
    body {
        background-color: #f0f2f5;
        color: #333;
    }

    .main-section {
        background-color: #ffffff;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }

    h1 {
        color: #007bff; /* 青系のアクセントカラー */
        text-shadow: none;
    }

    .message {
        color: #333; /* テキストを暗く */
    }
    .success-message {
        background-color: #d4edda;
        border-color: #c3e6cb;
        color: #155724; /* 濃い緑 */
    }
    .error-message {
        background-color: #f8d7da;
        border-color: #f5c6cb;
        color: #721c24; /* 濃い赤 */
    }

    .contact-form label {
        color: #333;
    }

    .contact-form input[type="text"],
    .contact-form input[type="email"],
    .contact-form textarea {
        border: 1px solid #ced4da;
        background-color: #fff;
        color: #333;
    }

    .contact-form input[type="text"]::placeholder,
    .contact-form input[type="email"]::placeholder,
    .contact-form textarea::placeholder {
        color: #aaa;
    }

    .contact-form input[type="text"]:focus,
    .contact-form input[type="email"]:focus,
    .contact-form textarea:focus {
        border-color: #007bff;
        box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3);
        background-color: #fff;
    }

    .submit-button {
        background-color: #007bff;
        box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2);
    }

    .submit-button:hover {
        background-color: #0056b3;
        box-shadow: 0 6px 15px rgba(0, 123, 255, 0.3);
    }

    .recaptcha-notice {
        color: #666;
    }

    .recaptcha-notice a {
        color: #007bff;
        border-bottom-color: #007bff;
    }

    .recaptcha-notice a:hover {
        color: #0056b3;
        border-color: #0056b3;
    }

    .back-link a {
        background-color: #e9ecef;
        color: #495057;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    }

    .back-link a:hover {
        background-color: #dee2e6;
    }
}


/* レスポンシブデザインの調整 */
@media (max-width: 768px) {
    .main-section {
        padding: 20px;
        margin: 1rem auto;
    }
    h1 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    .contact-form label {
        font-size: 0.95rem;
    }
    .contact-form input,
    .contact-form textarea,
    .submit-button {
        padding: 10px 12px;
        font-size: 0.95rem;
    }
    .recaptcha-notice {
        font-size: 0.8rem;
        margin-top: 20px;
    }
    .back-link a {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .main-section {
        padding: 15px;
        margin: 0.5rem auto;
        border-radius: 8px;
    }
    h1 {
        font-size: 1.6rem;
        margin-bottom: 1rem;
    }
    .form-group {
        margin-bottom: 15px;
    }
    .contact-form input,
    .contact-form textarea,
    .submit-button {
        font-size: 0.9rem;
        padding: 10px;
    }
    .submit-button {
        margin-top: 20px;
    }
    .recaptcha-notice {
        font-size: 0.75rem;
        margin-top: 15px;
    }
    .back-link a {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}