@charset "UTF-8";

/* ================= 全局樣式設定 ================= */
body {
    font-family: 'Segoe UI', 'Microsoft JhengHei', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #333;
    padding: 20px;
}

/* ================= 上方標題與 Logo 區塊 ================= */
.header-section {
    text-align: center;
    margin-bottom: 35px;
}

.login-logo {
    width: 100px;
    height: auto;
    max-width: 100%;
    display: block;
    margin: 0 auto 15px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.05));
}

.header-section h1 {
    font-size: 26px;
    color: #1a2a3a;
    margin: 0 0 5px 0;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.header-section h2 {
    font-size: 24px;
    color: #303030;
    font-weight: bold;
    margin: 0;
}

/* ================= 白色卡片主體 ================= */
.login-container {
    background: white;
    width: 100%;
    max-width: 400px;
    padding: 35px 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    text-align: center;
    box-sizing: border-box;
}

.login-container h3 {
    margin: 0 0 20px 0;
    font-size: 22px;
    color: #333;
    font-weight: 600;
}

.description {
    font-size: 18px;
    color: #242424;
    margin-bottom: 25px;
    line-height: 1.5;
    text-align: justify;
}

/* ================= 輸入框組 ================= */
.input-group {
    margin-bottom: 16px;
    text-align: left;
    position: relative;
}

input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

input:focus {
    border-color: #007bff;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
    outline: none;
}

/* 密碼欄位與眼睛圖示 (註冊/重設密碼用) */
.password-wrapper, .password-field {
    position: relative;
    width: 100%;
    text-align: left;
}
.password-wrapper { margin-bottom: 0; }
.password-field { margin-bottom: 18px; }

.password-wrapper input, .password-field input {
    padding-right: 45px; /* 為眼睛留出空間 */
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.2rem;
    color: #999;
    user-select: none;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: #333;
}

/* 驗證碼專用輸入框 (OTP頁面用) */
#otpInput {
    text-align: center;
    letter-spacing: 6px;
    font-size: 18px;
}
#otpInput::placeholder {
    letter-spacing: normal;
    font-size: 15px;
    color: #aaa;
}

/* ================= 狀態與提示文字 ================= */
.feedback {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.4;
    padding-left: 4px;
}
.feedback.success { color: #28a745; }
.feedback.error { color: #dc3545; }
.feedback.info { color: #6c757d; }

#errorMsg, #status {
    min-height: 20px;
    margin: 15px 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

/* ================= 按鈕設計 ================= */
/* 主要按鈕 (登入、註冊等) */
.btn-login, .btn-primary {
    width: 100%;
    padding: 14px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}
.btn-login:hover:not(:disabled), .btn-primary:hover:not(:disabled) { 
    background-color: #0056b3; 
    transform: translateY(-1px); 
}
.btn-login:active:not(:disabled), .btn-primary:active:not(:disabled) { 
    transform: scale(0.98); 
}
.btn-login:disabled, .btn-primary:disabled { 
    background-color: #b3d7ff; 
    cursor: not-allowed; 
}

/* 次要按鈕 (獲取驗證碼) */
.btn-secondary {
    width: 100%;
    padding: 12px;
    background-color: transparent;
    color: #007bff;
    border: 1.5px solid #007bff;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 5px;
}
.btn-secondary:hover:not(:disabled) { background-color: #f0f8ff; }
.btn-secondary:active:not(:disabled) { transform: scale(0.98); }
.btn-secondary:disabled {
    color: #b0b0b0;
    border-color: #dcdcdc;
    cursor: not-allowed;
    background-color: #fafafa;
}

/* ================= 其他輔助元件 ================= */
.links {
    margin-top: 20px;
    font-size: 14px;
}
.links a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s;
    margin: 0 5px;
}
.links a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.divider {
    margin: 20px 0;
    border-top: 1px dashed #e0e0e0;
}

/* OTP 重新發送區塊 */
.resend-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}
#countdown {
    font-size: 13px;
    color: #777;
}

/* 登入頁測試工具按鈕 */
.tools-group {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.btn-tool {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.3s;
}
.btn-tool:hover {
    opacity: 0.8;
}
