/* 登錄頁面專用樣式：取消 main 的 margin-top */
body:has(.auth-container) main {
    margin-top: 0 !important;
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 95px); /* 減去 navbar 高度 */
    padding: 2rem 1rem;
    margin-top: 0;
    margin-bottom: 2rem; /* 確保 footer 需要滾動才能看到 */
}

@media (max-width: 767.98px) {
    body:has(.auth-container) main {
        margin-top: 0 !important;
    }
    
    .auth-container {
        min-height: calc(100vh - 85px); /* 手機版 navbar 較矮 */
    }
}

.auth-card {
    width: 100%;
    max-width: 450px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.auth-header {
    background: linear-gradient(135deg, #1a2a6c, #2c3e50);
    padding: 1.5rem;
    text-align: center;
    color: #fff;
}

.auth-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
    font-weight: 600;
}

.auth-subtitle {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.auth-card form {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* 當 form-control 不在 input-group 內時才應用這些樣式 */
.form-group:not(:has(.input-group)) .form-control:focus {
    outline: none;
    border-color: #1a2a6c;
    box-shadow: 0 0 0 3px rgba(26, 42, 108, 0.1);
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #dc3545;
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}

/* 統一輸入框和查詢按鈕樣式（參考 VIP 設計） */
.input-group {
    display: flex;
    position: relative;
    border-radius: 10px;
    overflow: visible;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: none;
    margin-bottom: 1.5rem !important;
}

.input-group .form-control {
    flex: 1;
    border: none !important;
    border-radius: 8px 0 0 8px !important;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group .form-control:focus {
    box-shadow: none !important;
    border-color: transparent !important;
}

.input-group .btn-outline-primary {
    border: none;
    border-radius: 0 8px 8px 0 !important;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: #f8f9fa;
    color: #0d6efd;
    margin-left: 0;
    z-index: 2;
}

.input-group .btn-outline-primary:hover {
    background: #0d6efd;
    color: #fff;
    border: none;
}

.input-group .btn-outline-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
    border: none;
}

.input-group .btn-outline-primary i {
    font-size: 1rem;
}

.input-group:focus-within {
    border-color: #1a2a6c;
    box-shadow: 0 0 0 0.25rem rgba(26, 42, 108, 0.25);
}

/* 當 form-control 不在 input-group 內時才應用這些樣式 */
.form-group > .form-control:not(.input-group .form-control) {
}

.btn-auth {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #1a2a6c, #2c3e50);
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-auth:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 42, 108, 0.3);
}

.btn-auth:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-footer {
    padding: 1.5rem 2rem;
    text-align: center;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.auth-footer p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.auth-footer a {
    color: #1a2a6c;
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* 忘記密碼連結樣式 */
.forgot-password-link {
    color: #1a2a6c;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.forgot-password-link:hover {
    color: #0d6efd;
    text-decoration: underline;
}

.user-info-card {
    margin: 1rem 0;
    padding: 1rem;
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
}

.user-info-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #1a2a6c;
}

.user-info-header i {
    font-size: 1.2rem;
}

.user-info-content p {
    margin: 0.5rem 0;
    color: #333;
}

/* 密碼登入區域樣式 */
#passwordLoginSection {
    display: none;
    margin-top: 1rem;
    animation: fadeIn 0.3s ease-in;
}

/* 確保密碼區域在顯示時正確顯示（兼容手機瀏覽器） */
#passwordLoginSection[style*="display: block"],
#passwordLoginSection:not([style*="display: none"]):not([hidden]) {
    display: block !important;
    visibility: visible !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 驗證碼模態框 */
.verification-instructions {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #1a2a6c;
}

.instruction-step {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.instruction-icon {
    font-size: 2rem;
    color: #1a2a6c;
}

.instruction-text {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    line-height: 1.6;
}

.verification-code-display {
    margin: 2rem 0;
}

.code-label {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.code-value-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.code-command {
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 0.2rem;
    color: #1a2a6c;
    background: #f8f9fa;
    padding: 1rem 2rem;
    border-radius: 8px;
    border: 2px dashed #1a2a6c;
    font-family: 'Courier New', monospace;
    flex: 0 0 auto;
    word-break: break-all;
    text-align: center;
}

.code-value {
    font-size: 2.5rem;
    font-weight: bold;
    letter-spacing: 0.5rem;
    color: #1a2a6c;
    background: #f8f9fa;
    padding: 1rem 2rem;
    border-radius: 8px;
    border: 2px dashed #1a2a6c;
    font-family: 'Courier New', monospace;
    flex: 0 0 auto;
}

.btn-copy-code {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-copy-code:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-copy-code i {
    font-size: 1.1rem;
}

.btn-copy-code.btn-success {
    background-color: #28a745;
    border-color: #28a745;
    color: #fff;
}

.btn-copy-code.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.instruction-detail {
    margin-top: 1rem;
}

.code-hint {
    font-size: 0.95rem;
    color: #495057;
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.code-hint i {
    color: #1a2a6c;
}

.code-expiry {
    font-size: 0.875rem;
    color: #6c757d;
    margin: 0.5rem 0 0 0;
}

.verification-status {
    margin-top: 2rem;
}

.verification-status p {
    margin-top: 1rem;
    color: #6c757d;
}

.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

/* 遊戲帳號資訊卡片 */
.account-info-card {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: linear-gradient(135deg, #e7f3ff 0%, #f0f8ff 100%);
    border: 2px solid #1a2a6c;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(26, 42, 108, 0.15);
}

.account-info-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a2a6c;
}

.account-info-header i {
    font-size: 1.3rem;
    color: #28a745;
}

.account-info-content {
    margin: 1rem 0;
    text-align: left;
}

.account-info-item {
    margin: 0.75rem 0;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(26, 42, 108, 0.1);
}

.account-info-item:last-child {
    border-bottom: none;
}

.account-info-item strong {
    display: inline-block;
    min-width: 100px;
    color: #495057;
    font-weight: 600;
}

.account-info-item .account-value {
    color: #1a2a6c;
    font-weight: 500;
    font-size: 1.05rem;
}

.account-info-warning {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #856404;
}

.account-info-warning i {
    color: #ffc107;
    font-size: 1.1rem;
}

/* 簡化版驗證碼對話框樣式 */
.account-info-compact {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f0f8ff;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #333;
}

.account-info-compact i {
    color: #1a2a6c;
    font-size: 1.1rem;
}

.verification-code-compact {
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.code-command-compact {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 0.15rem;
    color: #1a2a6c;
    background: #f8f9fa;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: 2px solid #1a2a6c;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    text-align: center;
    min-width: 200px;
}

.btn-copy-code-compact {
    padding: 0.5rem 1.25rem;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-copy-code-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.verification-instructions-compact {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #1a2a6c;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.75rem 0;
    font-size: 0.9rem;
    color: #495057;
}

.instruction-item:first-child {
    margin-top: 0;
}

.instruction-item:last-child {
    margin-bottom: 0;
}

.instruction-item i {
    color: #1a2a6c;
    font-size: 1rem;
    flex-shrink: 0;
}

.instruction-item strong {
    color: #1a2a6c;
    font-weight: 600;
    background: #e7f3ff;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.verification-status-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
    font-size: 0.95rem;
    color: #6c757d;
}

#verificationModal .modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

#verificationModal .modal-header {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

#verificationModal .modal-header .btn-close {
    display: none;
}

/* 響應式設計 */
@media (max-width: 576px) {
    .auth-container {
        padding: 2rem 1rem;
    }

    .auth-card form {
        padding: 1.5rem;
    }

    .code-value-container {
        flex-direction: column;
        gap: 0.75rem;
    }

    .instruction-step {
        flex-direction: column;
        text-align: center;
    }

    .instruction-icon {
        font-size: 1.5rem;
    }

    .instruction-text {
        font-size: 1rem;
    }

    .code-command {
        font-size: 1.4rem;
        letter-spacing: 0.1rem;
        padding: 0.75rem 1rem;
        width: 100%;
    }

    .code-value {
        font-size: 2rem;
        letter-spacing: 0.3rem;
        padding: 0.75rem 1.5rem;
        width: 100%;
    }

    .btn-copy-code {
        width: 100%;
        justify-content: center;
    }
}

/* 自定義 Tooltip 樣式（參考 VIP 設計） */
.custom-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.custom-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(0, 0, 0, 0.85);
}

/* 當tooltip顯示在下方時的箭頭樣式 */
.custom-tooltip.tooltip-bottom::after {
    bottom: auto;
    top: -6px;
    border-top: none;
    border-bottom: 6px solid rgba(0, 0, 0, 0.85);
}

