/**
 * サイドバー用問い合わせフォームスタイル（Figmaデザイン準拠）
 */

.tobeshin-sidebar-form-figma {
    width: 100%;
    max-width: 340px;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* 上部バナー */
.tobeshin-sidebar-form__banner {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 59.12%; /* 201/340 * 100 = 59.12% (aspect-ratio: 340/201) */
    margin: 0;
    overflow: visible;
}

.tobeshin-sidebar-form__banner-background {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* バナーの高さを固定して位置を安定させる */
}

.tobeshin-sidebar-form__banner-bg-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: top center;
    pointer-events: none;
    display: block;
}

.tobeshin-sidebar-form__banner-tel {
    position: absolute;
    left: 5%;
    top: 61.3%;
    width: 90%;
    height: 37.8%;
    z-index: 2;
    display: block;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.tobeshin-sidebar-form__banner-tel:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.tobeshin-sidebar-form__banner-tel:active {
    opacity: 0.8;
    transform: scale(0.98);
}

.tobeshin-sidebar-form__banner-tel-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
}

/* フォーム部分 */
.tobeshin-sidebar-form__form-wrapper {
    position: relative;
    padding: 0;
    background: white;
}

.tobeshin-sidebar-form__form {
    position: relative;
    padding: 0;
    margin: 0;
}

.tobeshin-sidebar-form__field {
    position: relative;
    margin-bottom: 0;
    padding: 0 30px;
}

/* フィールドの位置調整（Figmaデザイン準拠） */
.tobeshin-sidebar-form__field:nth-of-type(1) {
    margin-top: 12px;
    margin-bottom: 12px;
}

.tobeshin-sidebar-form__field:nth-of-type(2) {
    margin-bottom: 12px;
}

.tobeshin-sidebar-form__field:nth-of-type(3) {
    margin-bottom: 12px;
}

.tobeshin-sidebar-form__field:nth-of-type(4) {
    margin-bottom: 10px;
}

.tobeshin-sidebar-form__label {
    display: flex;
    align-items: center;
    gap: 11.609px;
    height: auto;
    min-height: 29px;
    margin-bottom: 6px;
}

.tobeshin-sidebar-form__label-text {
    font-family: 'A-OTF Futo Go B101 Pr5', 'Noto Sans JP', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #444;
    letter-spacing: 0.36px;
    line-height: 1.9;
    text-align: right;
}

.tobeshin-sidebar-form__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4.643px 6.965px;
    border-radius: 2.322px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: white;
    letter-spacing: 1.56px;
    line-height: 1;
    white-space: nowrap;
    text-align: justify;
}

.tobeshin-sidebar-form__badge--required {
    background: #fc650d;
}

.tobeshin-sidebar-form__badge--optional {
    background: #6f6f6f;
}

.tobeshin-sidebar-form__input {
    width: 100%;
    max-width: 280px;
    height: 42px;
    padding: 0 19px;
    background: white;
    border: 2px solid #ff5656;
    border-radius: 8px;
    font-size: 18px;
    font-family: 'A-OTF Futo Go B101 Pr5', 'Noto Sans JP', sans-serif;
    font-weight: 700;
    color: #444;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

/* パルスアニメーション（オレンジ系）- 次の入力欄のみ */
.tobeshin-sidebar-form__input.needs-attention {
    animation: inputPulseOrange 1.5s ease-in-out infinite;
}

/* パルスアニメーション（オレンジ系）- 強化版 */
@keyframes inputPulseOrange {
    0%, 100% {
        border-color: #ff6900;
        box-shadow: 0 0 0 0 rgba(255, 105, 0, 0.6);
        background-color: white;
    }
    50% {
        border-color: #ff8800;
        box-shadow: 0 0 0 8px rgba(255, 105, 0, 0.5), 0 0 0 12px rgba(255, 105, 0, 0.3);
        background-color: #fff8f0;
    }
}

.tobeshin-sidebar-form__input:focus {
    outline: none;
    border-color: #ff5656;
    animation: none;
    box-shadow: 0 0 0 3px rgba(255, 86, 86, 0.2);
}

.tobeshin-sidebar-form__input.is-error {
    border-color: #ff5656;
    animation: inputPulseError 1.5s ease-in-out infinite;
}

/* エラー時のパルスアニメーション - 赤色（エラー時のみ） */
@keyframes inputPulseError {
    0%, 100% {
        border-color: #ff5656;
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7);
        background-color: white;
    }
    50% {
        border-color: #ff0000;
        box-shadow: 0 0 0 10px rgba(255, 0, 0, 0.6), 0 0 0 16px rgba(255, 0, 0, 0.4);
        background-color: #ffe5e5;
    }
}

.tobeshin-sidebar-form__input::placeholder {
    color: #ababab;
    font-family: 'A-OTF Futo Go B101 Pr5', 'Noto Sans JP', sans-serif;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.36px;
}

.tobeshin-sidebar-form__postal-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.tobeshin-sidebar-form__input--postal {
    width: 100%;
    max-width: 160px;
    flex-shrink: 0;
}

.tobeshin-sidebar-form__postal-button {
    height: 40px;
    padding: 0 10px;
    background: #545454;
    border: none;
    border-radius: 4.977px;
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
    min-width: 100px;
    flex-shrink: 0;
}

.tobeshin-sidebar-form__postal-button:hover {
    background: #424242;
}

.tobeshin-sidebar-form__postal-button:active {
    background: #3a3a3a;
}

.tobeshin-sidebar-form__input-hint {
    font-size: 10px;
    color: #123c16;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 500;
    letter-spacing: 0.2px;
    line-height: 1.9;
    margin: 6px 0 0;
}

.tobeshin-sidebar-form__error {
    font-size: 12px;
    color: #ff5656;
    margin-top: 4px;
    display: none;
    line-height: 1.4;
}

.tobeshin-sidebar-form__error.is-visible {
    display: block;
}

.tobeshin-sidebar-form__privacy {
    margin-top: 0;
    margin-bottom: 8px;
    width: 100%;
    max-width: 280px;
    margin-left: 30px;
    padding: 0;
}

.tobeshin-sidebar-form__privacy p {
    font-family: 'A-OTF Futo Go B101 Pr5', 'Noto Sans JP', sans-serif;
    font-size: 12px;
    color: #444;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    letter-spacing: 0.24px;
    white-space: pre-wrap;
}

.tobeshin-sidebar-form__privacy-link {
    color: #444;
    text-decoration: underline;
    text-underline-position: from-font;
    text-decoration-skip-ink: none;
    text-decoration-style: solid;
}

.tobeshin-sidebar-form__privacy-link:hover {
    opacity: 0.8;
}

.tobeshin-sidebar-form__submit {
    margin-top: 0;
    margin-bottom: 12px;
    margin-left: 30px;
    margin-right: 30px;
    position: relative;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.tobeshin-sidebar-form__button {
    position: relative;
    width: 100%;
    max-width: 280px;
    height: 62px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: block;
    transition: transform 0.2s, opacity 0.2s;
}

.tobeshin-sidebar-form__button:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.tobeshin-sidebar-form__button:active {
    transform: translateY(0);
    opacity: 0.95;
}

.tobeshin-sidebar-form__button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.tobeshin-sidebar-form__button-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
    pointer-events: none;
}

.tobeshin-sidebar-form__success {
    background: rgba(255, 255, 255, 0.9);
    color: #00bc14;
    border: 2px solid #2ba738;
    border-radius: 8px;
    padding: 20px;
    margin-top: 16px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.6;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .tobeshin-sidebar-form-figma {
        width: 100%;
        max-width: 100%;
    }

    .tobeshin-sidebar-form__banner {
        aspect-ratio: 340 / 201;
    }

    .tobeshin-sidebar-form__field {
        padding: 0 15px;
    }

    .tobeshin-sidebar-form__input {
        width: 100%;
        max-width: 100%;
        font-size: 16px; /* iOSでズームを防ぐ */
    }

    .tobeshin-sidebar-form__input--postal {
        max-width: calc(100% - 120px);
    }

    .tobeshin-sidebar-form__postal-button {
        min-width: 100px;
        padding: 0 8px;
        font-size: 14px;
    }

    .tobeshin-sidebar-form__privacy {
        margin-left: 15px;
        width: calc(100% - 30px);
        max-width: 100%;
    }

    .tobeshin-sidebar-form__submit {
        margin-left: 15px;
        margin-right: 15px;
    }

    .tobeshin-sidebar-form__button {
        max-width: 100%;
        height: auto;
        min-height: 50px;
    }

    .tobeshin-sidebar-form__button-img {
        width: 100%;
        height: auto;
    }

    .tobeshin-sidebar-form__button {
        max-width: 100%;
        height: auto;
        min-height: 50px;
    }

    .tobeshin-sidebar-form__button-img {
        width: 100%;
        height: auto;
    }

    .tobeshin-sidebar-form__field:nth-of-type(1) {
        margin-top: 10px;
        margin-bottom: 10px;
    }

    .tobeshin-sidebar-form__field:nth-of-type(2),
    .tobeshin-sidebar-form__field:nth-of-type(3),
    .tobeshin-sidebar-form__field:nth-of-type(4) {
        margin-bottom: 10px;
    }

    .tobeshin-sidebar-form__label {
        margin-bottom: 4px;
    }

    .tobeshin-sidebar-form__input {
        height: 38px;
        font-size: 16px;
    }

    .tobeshin-sidebar-form__postal-button {
        height: 38px;
    }

    .tobeshin-sidebar-form__privacy {
        margin-bottom: 6px;
    }

    .tobeshin-sidebar-form__submit {
        margin-bottom: 10px;
    }
}

/* 小さい画面での調整 */
@media (max-width: 480px) {
    .tobeshin-sidebar-form__field {
        padding: 0 10px;
    }

    .tobeshin-sidebar-form__input {
        font-size: 16px;
    }

    .tobeshin-sidebar-form__label-text {
        font-size: 16px;
    }

    .tobeshin-sidebar-form__badge {
        font-size: 11px;
        padding: 3px 5px;
    }

    .tobeshin-sidebar-form__privacy {
        margin-left: 10px;
        width: calc(100% - 20px);
    }

    .tobeshin-sidebar-form__submit {
        margin-left: 10px;
        margin-right: 10px;
    }

    .tobeshin-sidebar-form__button {
        max-width: 100%;
        height: auto;
        min-height: 45px;
    }

    .tobeshin-sidebar-form__button-img {
        width: 100%;
        height: auto;
    }
}
