/**
 * 認証モーダル CSS
 * Trading Complete - Auth Styles
 * 
 * @version 1.0.0
 * @date 2025-12-17
 */

/* ============================================
   認証モーダル オーバーレイ
   ============================================ */

.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.auth-modal.show {
    display: flex;
}

/* ============================================
   モーダルコンテナ
   ============================================ */

.auth-container {
    background: var(--bg-primary, #1a1a2e);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 420px;
    margin: 20px;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   ヘッダー
   ============================================ */

.auth-header {
    text-align: center;
    padding: 30px 30px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-logo {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* ロゴ画像を丸形に */
.auth-logo img {
    border-radius: 50%;
    object-fit: cover;
}

.auth-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary, #e0e0e0);
    margin: 0 0 5px;
}

.auth-header p {
    color: var(--text-secondary, #888);
    font-size: 0.9rem;
    margin: 0;
}

/* ============================================
   タブ
   ============================================ */

.auth-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    background: none;
    border: none;
    color: var(--text-secondary, #888);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.auth-tab:hover {
    color: var(--text-primary, #e0e0e0);
    background: rgba(255, 255, 255, 0.05);
}

.auth-tab.active {
    color: var(--accent-primary, #00d4ff);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-primary, #00d4ff);
}

/* ============================================
   フォーム
   ============================================ */

.auth-body {
    padding: 30px;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary, #e0e0e0);
    font-size: 0.9rem;
    font-weight: 500;
}

.input-wrapper {
    position: relative;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    padding-right: 45px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary, #e0e0e0);
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary, #00d4ff);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary, #888);
}

/* パスワード表示切り替えボタン */
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary, #888);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
}

.toggle-password:hover {
    color: var(--text-primary, #e0e0e0);
}

/* ============================================
   ボタン
   ============================================ */

.auth-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent-primary, #00d4ff), var(--accent-secondary, #7c3aed));
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.auth-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.3);
}

.auth-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ============================================
   メッセージ
   ============================================ */

.auth-error {
    display: none;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
    color: #fca5a5;
    font-size: 0.9rem;
}

.auth-success {
    display: none;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
    color: #6ee7b7;
    font-size: 0.9rem;
}

/* ============================================
   フッター
   ============================================ */

.auth-footer {
    text-align: center;
    padding: 20px 30px 30px;
    color: var(--text-secondary, #888);
    font-size: 0.85rem;
}

.auth-footer a {
    color: var(--accent-primary, #00d4ff);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   ユーザー情報（ヘッダー用）
   ============================================ */

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-email {
    color: var(--text-secondary, #888);
    font-size: 0.9rem;
}

#logout-btn {
    display: none;
    padding: 6px 12px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: #fca5a5;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#logout-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* ============================================
   レスポンシブ
   ============================================ */

@media (max-width: 480px) {
    .auth-container {
        margin: 10px;
        max-width: none;
    }

    .auth-header {
        padding: 20px 20px 15px;
    }

    .auth-body {
        padding: 20px;
    }

    .auth-header h2 {
        font-size: 1.3rem;
    }
}

/* ========================================
   マイページスタイル（Phase 3.5）
   ======================================== */

.mypage-item {
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mypage-item label {
    display: block;
    font-size: 0.85em;
    color: #888;
    margin-bottom: 8px;
}

.mypage-value-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.mypage-value {
    font-size: 1.1em;
    color: #e0e0e0;
    word-break: break-all;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85em;
}

.mypage-logout-section {
    text-align: center;
    padding: 20px;
}

.btn-logout {
    background: linear-gradient(135deg, #ff4757, #c0392b);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: linear-gradient(135deg, #ff6b7a, #e74c3c);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
}

/* ライトモード対応 */
body.light-mode .mypage-item {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .mypage-value {
    color: #333;
}

body.light-mode .mypage-item label {
    color: #666;
}

/* ========================================
   パスワードリセットリンク（Phase 3.5）
   ======================================== */

.auth-link {
    text-align: center;
    margin-top: 15px;
}

.auth-link a {
    color: var(--primary-color);
    font-size: 0.9rem;
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* パスワードリセットモーダル z-index修正 */
#resetPasswordModal {
    z-index: 10001;
}

/* パスワードリカバリー警告バナー */
.recovery-warning {
    background-color: #ff9800;
    color: #000;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: bold;
    text-align: center;
}