/* 基本重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft JhengHei", sans-serif;
}

body {
    background-color: #f8f9fa; /* 淺灰背景 */
    color: #343a40;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden; /* 防止背景圓溢出 */
    position: relative;
}

/* 背景漸變圓 (不使用圖片) */
.bg-gradient-circle {
    position: absolute;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    background: radial-gradient(circle, #f8f9fa 0%, #e0e0e0 100%);
    filter: blur(50px);
    opacity: 0.5;
    z-index: -1;
    top: -200px;
    right: -200px;
}

/* 主容器：兩欄式的 Flexbox 排版 */
.main-wrapper {
    display: flex;
    width: 90%;
    max-width: 1000px;
    gap: 50px; /* 兩欄間距 */
    align-items: center;
}

/* 左側：登入表單卡片 */
.login-card {
    background: #ffffff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); /* 更輕的陰影 */
    flex: 1; /* 佔用可用空間 */
    max-width: 460px;
}

.login-card header h2 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 20px;
}

/* 表單通用樣式 */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
    color: #495057;
}

.required {
    color: #dc3545; /* 紅色星號 */
    margin-left: 3px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding-right: 10px; /* 給圖示一點呼吸空間 */
    transition: 0.2s;
}

.input-wrapper input {
    flex: 1; /* 讓輸入框佔滿剩餘空間 */
    border: none; /* 移除內部邊框避免重疊 */
}

.icon-eye-toggle {
    cursor: pointer;
    font-size: 18px;
    color: #999;
    padding: 0 12px; /* 增加點擊範圍 */
    user-select: none;
    margin-left: 5px;
    display: flex;
    align-items: center;
}

.input-wrapper:focus-within {
    border-color: #343a40; /* 聚焦時變深灰 */
}

input[type="text"], input[type="password"] {
    flex: 1;
    padding: 12px;
    border: none;
    outline: none;
    font-size: 16px;
    border-radius: 6px;
}

/* 模擬圖示 */
.icon-eye {
    cursor: pointer;
    color: #999;
    padding: 0 12px;
    user-select: none;
    font-size: 18px;
}

/* 手機號碼區塊精細化 */
.phone-group .input-wrapper {
    gap: 0;
}

.fake-select {
    display: flex;
    align-items: center;
    padding: 0 10px 0 15px;
    border-right: 1px solid #ced4da;
    color: #495057;
    font-size: 14px;
    cursor: pointer;
}

.flag-placeholder {
    width: 20px;
    height: 14px;
    background-color: #eee;
    margin-right: 8px;
}

.fake-select .arrow {
    font-size: 10px;
    margin-left: 5px;
    color: #999;
    text-align: center;
}

/* 密碼區塊細節 */
.help-text-block {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 5px;
}

.small-text {
    font-size: 11px;
    color: #999;
    max-width: 80%;
}

.blue-link {
    text-decoration: none;
    color: #007bff; /* 藍色連結 */
    font-size: 12px;
    transition: 0.2s;
}

.forget-pass {
    align-self: flex-end;
}

/* 驗證碼區塊精細化 */
.captcha-group .input-wrapper {
    border: none;
}

.captcha-group input {
    border: 1px solid #ced4da;
}

.captcha-box {
    width: 100px;
    height: 48px; /* 與輸入框高度一致 */
    background: #eee;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    border-radius: 6px;
    margin-left: 10px;
}

.captcha-help {
    margin-top: 5px;
    text-align: right;
    max-width: 100%;
}

/* OTP 接收方式 */
.otp-group label {
    font-weight: bold;
}

.radio-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.radio-wrapper input {
    margin-right: 10px;
}

.radio-wrapper label {
    font-weight: normal;
    margin-bottom: 0;
}

/* 提示文字 */
.red-text {
    color: #dc3545;
    font-size: 12px;
    margin: 15px 0;
    text-align: center;
}

.red-link {
    text-decoration: none;
    color: #dc3545;
}

/* 登入按鈕 */
.submit-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
}

.black-btn {
    background-color: #000000; /* 黑色按鈕 */
    color: white;
}

.black-btn:hover {
    background-color: #333333;
}

/* 右側內容區塊 */
.info-section {
    flex: 1; /* 佔用可用空間 */
    max-width: 460px;
    text-align: center;
}

.logo-area {
    margin-bottom: 20px;
}

.brand-logo {
    width: auto;
    height: 35px; /* 調整 Logo 高度 */
    margin-bottom: 10px;
    /* 這裡使用一個佔位符，因為不引用外站圖片 */
    background-color: #eee;
    display: inline-block;
}

.logo-area p {
    font-size: 28px;
    font-weight: bold;
    color: #000;
}

.sub-text {
    font-size: 16px;
    color: #6c757d;
    margin-bottom: 40px;
    text-align: center;
}

/* QR Code 卡片 */
.qr-card {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    max-width: 300px;
    margin: 0 auto;
    text-align: center;
}

.qr-card .small-text {
    display: block;
    width: 100%;          /* 確保寬度是 100% */
    max-width: none;       /* 重點：解除先前可能設定的 80% 限制 */
    margin: 10px auto;     /* 上下 10px，左右自動置中 */
    font-size: 12px;
    color: #999;           /* 你可以在這裡改顏色，例如 #666 */
    text-align: center;    /* 文字內容置中 */
    line-height: 1.4;      /* 讓換行後的行距比較自然 */
    padding: 0 10px;       /* 增加一點左右內距，防止貼到邊框 */
}

.qr-card h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.qr-img {
    width: 100%;
    height: 100%;
    margin: 15px auto;
    display: block;
    /* 佔位符 */
    background-color: #eee;
    transition: filter 0.3s;
}

.count-down {
    font-size: 12px;
    color: #6c757d;
}

#timer {
    color: #007bff; /* 藍色倒數 */
}
/* 下拉選單樣式 */
.country-select {
    border: none;
    background: transparent;
    padding: 0 10px 0 15px;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    border-right: 1px solid #ced4da;
    outline: none;
    -webkit-appearance: none; /* 移除瀏覽器預設箭頭 */
}

/* QR Code 容器與遮罩 */
.qr-container {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 15px auto;
}

.qr-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85); /* 半透明白 */
    display: none; /* 預設隱藏 */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
}

.refresh-circle {
    background: #007bff;
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.refresh-circle span {
    font-size: 10px;
    margin-top: 4px;
}

.qr-expired .qr-img {
    filter: blur(4px);
}

.refresh-circle-only {
    background: #007bff;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s;
}

.refresh-circle-only:hover {
    transform: rotate(180deg); /* 增加一點互動感 */
}