/**
 * 登録ページレスポンシブ対応
 * モバイル・タブレット・デスクトップ対応
 */

/* モバイル対応（640px以下） */
@media (max-width: 640px) {
    /* 認証コンテナ */
    .auth-container {
        padding: 20px 10px !important;
    }
    
    /* 認証カード */
    .auth-card {
        padding: 30px 20px !important;
        margin: 0 !important;
        border-radius: 20px !important;
    }
    
    /* ヘッダー */
    .auth-header h1 {
        font-size: 1.5rem !important;
    }
    
    .auth-title {
        font-size: 1.25rem !important;
        margin-bottom: 20px !important;
    }
    
    /* プログレスインジケーター */
    .registration-progress {
        overflow-x: auto;
        padding-bottom: 10px;
        margin: 20px -10px;
        padding: 0 10px 10px;
    }
    
    .progress-step {
        min-width: 50px;
    }
    
    .step-number {
        width: 30px;
        height: 30px;
        font-size: 0.875rem;
    }
    
    .step-label {
        font-size: 0.625rem;
    }
    
    /* フォーム要素 */
    .auth-form input,
    .auth-form textarea,
    .auth-form select {
        padding: 12px 16px !important;
        font-size: 16px !important; /* iOSのズーム防止 */
    }
    
    /* ボタン */
    .auth-button {
        padding: 14px 24px !important;
        font-size: 1rem !important;
    }
    
    /* チャレンジセクション */
    .challenges-section {
        gap: 15px !important;
    }
    
    .challenge-group {
        padding: 15px !important;
    }
    
    .challenge-group h4 {
        font-size: 1rem !important;
        margin-bottom: 10px !important;
    }
    
    /* スキル・興味グリッド */
    .skills-checkbox-grid,
    .interests-checkbox-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    
    .skill-category-section,
    .interest-category-section {
        padding: 15px !important;
        margin-bottom: 15px !important;
    }
    
    /* フォームナビゲーション */
    .form-navigation {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .form-navigation button {
        width: 100% !important;
    }
    
    /* 紹介情報 */
    .referral-info {
        padding: 12px !important;
        font-size: 0.875rem !important;
    }
    
    .referral-info i {
        font-size: 1.25rem !important;
    }
    
    /* ファイルアップロード */
    .file-upload-label {
        padding: 1.5rem !important;
        font-size: 0.875rem !important;
    }
    
    /* SNSボタン */
    .line-button {
        padding: 14px !important;
        font-size: 0.9375rem !important;
    }
}

/* タブレット対応（641px〜1024px） */
@media (min-width: 641px) and (max-width: 1024px) {
    /* 認証カード */
    .auth-card {
        max-width: 600px !important;
        padding: 40px 35px !important;
    }
    
    /* チャレンジセクション（2列） */
    .challenges-section {
        grid-template-columns: 1fr 1fr !important;
        gap: 20px !important;
    }
    
    /* スキル・興味グリッド（2列） */
    .skills-checkbox-grid,
    .interests-checkbox-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* プログレスステップ */
    .step-label {
        font-size: 0.75rem !important;
    }
}

/* 大画面デスクトップ対応（1025px以上） */
@media (min-width: 1025px) {
    /* ステップ2の特別な幅 */
    .auth-card:has(.form-step[data-step="2"].active) {
        max-width: 1000px !important;
    }
    
    /* チャレンジセクション（2列） */
    .challenges-section {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 25px !important;
    }
    
    /* スキル・興味グリッド（3列） */
    .skills-checkbox-grid,
    .interests-checkbox-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* 横向きモバイル対応 */
@media (max-height: 600px) and (orientation: landscape) {
    .auth-container {
        padding: 20px !important;
        min-height: auto !important;
    }
    
    .auth-card {
        margin: 0 auto !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }
    
    .registration-progress {
        margin: 15px 0 !important;
    }
}

/* タッチデバイス対応 */
@media (hover: none) and (pointer: coarse) {
    /* タッチしやすいボタンサイズ */
    .auth-button,
    .auth-button-outline {
        min-height: 48px !important;
    }
    
    /* チェックボックスのタッチエリア拡大 */
    .checkbox-label {
        padding: 12px !important;
        margin: 4px 0 !important;
    }
    
    /* ドロップダウンのタッチエリア */
    .auth-form select {
        min-height: 48px !important;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    /* 必要に応じてダークモードスタイルを追加 */
}

/* 印刷対応 */
@media print {
    .auth-container {
        background: white !important;
    }
    
    .auth-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .auth-button,
    .form-navigation {
        display: none !important;
    }
}

/* アクセシビリティ対応 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 高コントラストモード対応 */
@media (prefers-contrast: high) {
    .auth-card {
        border: 2px solid currentColor !important;
    }
    
    .auth-form input,
    .auth-form textarea,
    .auth-form select {
        border-width: 2px !important;
    }
}

/* Retinaディスプレイ対応 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .auth-card {
        border-width: 0.5px !important;
    }
}

/* スクロールバーのカスタマイズ（モバイル） */
@media (max-width: 768px) {
    .auth-card::-webkit-scrollbar {
        width: 4px !important;
    }
    
    .auth-card::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2) !important;
    }
}

/* フォームステップの高さ調整 */
.form-step {
    min-height: auto !important;
    padding-bottom: 20px !important;
}

/* オーバーフロー処理 */
.auth-card {
    max-height: calc(100vh - 40px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch; /* iOSスムーズスクロール */
}

/* フレックスボックスのフォールバック */
.form-navigation {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
}

/* グリッドのフォールバック */
.challenges-section {
    display: -ms-grid;
    display: grid;
}

/* iOS Safariの100vh問題対策 */
.auth-container {
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

/* Androidキーボード表示時の対策 */
@media (max-height: 500px) {
    .auth-container {
        min-height: auto !important;
    }
}