@charset "UTF-8";

/* フォーム共通ヘルパーCSS */

/* ===========================================
   フォーム補助要素
=========================================== */
.auth-form .form-group {
    margin-bottom: 24px;
    padding: 8px 0px;
}

.auth-form .form-label {
    display: block;
    color: var(--text);
    margin-bottom: 8px;
    font-size: 16px;
    font-style: normal;
    font-weight: 600;
    line-height: 160%; /* 25.6px */
    letter-spacing: 1.12px;
}

.auth-form .form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.auth-form .form-input::placeholder {
    color: var(--form-placeholder);
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 160%;
    letter-spacing: 0.64px;
}

@media screen and (max-width: 842px) {
    .auth-form .form-input {
        font-size: 15px;
        letter-spacing: 1.05px;
    }

    .auth-form .form-label{
        font-size: 15px;
        letter-spacing: 1.05px;
    }
    .auth-form .form-input::placeholder {
        font-size: 15px;
        letter-spacing: 1.05px;
    }
}

/* 補助テキスト・ヘルプテキスト */
.form-help {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
    line-height: 1.4;
}

.form-help.error {
    color: #F04547;
    display: block;
}

.form-help.success {
    color: #059669;
}

/* フィールドエラー用スタイル */
.field-error {
    margin-top: 4px;
    display: block;
    color: #dc2626;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 160%;
    letter-spacing: 0.98px;
}

@media screen and (max-width: 842px) {
    .field-error {
        font-size: 12px;
        letter-spacing: 0.84px;
        min-width: 295px;
    }
}

/* チェックボックスエラー用スタイル */
.checkbox-container .field-error {
    margin-top: 8px;
    width: 100%;
}

/* チェックボックスのカスタムスタイル */
.checkbox-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin-right: 8px;
    flex-shrink: 0;
    accent-color: #353131;
}

/* 文字数カウンター共通スタイル */
.character-counter {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.character-count {
    color: var(--gray);
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 160%; /* 22.4px */
    letter-spacing: 0.98px;
    margin-top: 6px;
}

/* ニックネームエラー時の文字数カウンター */
.nickname-counter .character-count.error {
    color: #F04547;
}

/* 入力エラー状態 */
.form-input.error,
.birthday-input.error {
    border: 1px solid #F04547 !important;
}

/* ローディング状態 */
.form-input.loading {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M12 2v4m0 12v4M4.93 4.93l2.83 2.83m8.48 8.48l2.83 2.83M2 12h4m12 0h4M4.93 19.07l2.83-2.83m8.48-8.48l2.83-2.83' stroke='%23999' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* フォーカス強化 */
.form-input:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* 必須項目マーカー */
.form-label.required::after {
    content: "必須";
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    border-radius: 2px;
    background: var(--Semantic-Primary-Main, #F87C52);
    color: var(--Semantic-Component-White, #FFF);
    font-family: "Noto Sans JP";
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    line-height: 160%; /* 19.2px */
    letter-spacing: 0.84px;
}

@media screen and (max-width: 842px) {
    .form-label.required::after{
        font-size: 10px;
        letter-spacing: 0.7px;
        padding: 0px 4px;
    }
}

/* ツールチップ */
.form-tooltip {
    position: relative;
    display: inline-block;
    margin-left: 4px;
    cursor: help;
}

.form-tooltip::before {
    content: "?";
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #6366f1;
    color: white;
    text-align: center;
    font-size: 12px;
    line-height: 16px;
    font-weight: bold;
}

.form-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #333;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}

.form-tooltip:hover::after {
    opacity: 1;
}
