/* 基礎 CSS 設定 */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}
body {
    font-family: Arial, sans-serif;
    background: url('../back.png') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}
.container {
    width: 100%;
    max-width: 380px;
    background: rgba(255,255,255,0.95);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    text-align: center;
    max-height: 95vh;
    overflow-y: auto;
}
img { 
    width: 200px; 
    margin-bottom: 15px; 
}
input, button {
    text-align: center;
    box-sizing: border-box;
    width: 100%;
    padding: 12px;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin: 8px 0;
}
button {
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s ease;
}
.password-input-field {
    padding-right: 45px !important;
}
.password-wrapper {
    margin-bottom: 8px;
}
.password-container {
    position: relative;
    display: flex;
    align-items: center;
}
.password-container input {
    margin: 0;
}
.toggle-password {
    position: absolute; 
    right: 15px; 
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer; 
    user-select: none;
}
button:hover { opacity: 0.9; }
button:active { transform: scale(0.98); }
#submitButton { background: #007bff; color: white; margin-top: 10px; }
#submitButton:disabled { background: #ccc; cursor: not-allowed; }

/* ✅ 新增：快速跳轉按鈕樣式（不受 Turnstile 影響） */
#quickLinkButton.btn-quick-link {
    background-color: #28a745;
    color: #fff;
    font-weight: 600;
}
#quickLinkButton.btn-quick-link:hover {
    background-color: #218838;
}

/* 讀取動畫 */
#loadingOverlay {
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(255,255,255,0.85); 
    z-index: 9999;
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    font-size: 18px; 
    color: #333;
}
.spinner {
    width: 40px; 
    height: 40px; 
    border: 4px solid #ccc; 
    border-top: 4px solid #007bff;
    border-radius: 50%; 
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}
@keyframes spin { 
    to { transform: rotate(360deg); } 
}

/* 提示訊息 */
.error-message {
    display: block; 
    height: 15px; 
    color: #d9534f;
    font-size: 12px; 
    text-align: left; 
    margin-top: -5px;
    visibility: hidden;
}
#resultMessage {
    padding: 10px; 
    margin-top: 10px; 
    border-radius: 5px;
    display: none; 
    text-align: center; 
    word-wrap: break-word;
}
.result-success { 
    background-color: #dff0d8; 
    color: #3c763d; 
    border: 1px solid #d6e9c6; 
}
.result-error { 
    background-color: #f2dede; 
    color: #a94442; 
    border: 1px solid #ebccd1; 
}

/* Turnstile 置中 */
#turnstile-widget {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}

/* RWD 特定樣式 */
body.rwd-page { padding: 0; }
body.rwd-page .container {
    max-height: 100%; 
    height: 100%; 
    border-radius: 0;
    box-shadow: none; 
    padding: 20px 15px;
}

/* 成功提示 Modal 樣式 */
.modal-overlay {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none; 
    justify-content: center; 
    align-items: center;
    z-index: 10000; 
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modal-overlay.visible {
    display: flex;
    opacity: 1;
}
.modal-content {
    background: #fff; 
    padding: 20px 30px; 
    border-radius: 10px;
    text-align: center; 
    width: 90%; 
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.25);
}
.modal-content h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: #222;
}
.modal-content p {
    margin: 8px 0;
    color: #333;
    line-height: 1.6;
}
.modal-reminder {
    color: #555;
    font-size: 14px;
}

/* 彈窗關閉按鈕（避免看起來消失） */
#modalCloseButton {
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #007bff;
    color: #fff !important;   /* 強制字是白色 */
    font-weight: bold;        /* 加粗避免不明顯 */
    font-size: 16px;          /* 調整字大小 */
    border: none;
    border-radius: 6px;
    cursor: pointer;
    width: auto;
    min-width: 96px;          /* 確保按鈕至少有寬度 */
    display: inline-block;
    text-align: center;       /* 文字置中 */
}
#modalCloseButton:hover {
    background-color: #0056b3;
}
