/* ========== 會員註冊表單樣式 - 套用 member-join-3.html 設計 v2.5 ========== */

/* CSS 樣式隔離 - 使用 wrapper class */
.cmm-register-form-wrapper {
    font-family: "Noto Sans TC", "微軟正黑體", Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 0;
    background: transparent;
}

.cmm-register-form-wrapper * {
    box-sizing: border-box;
}

/* 基本重置 */
.cmm-register-form-wrapper h1, 
.cmm-register-form-wrapper h2, 
.cmm-register-form-wrapper h3, 
.cmm-register-form-wrapper p {
    margin: 0 !important;
}

.cmm-register-form-wrapper a {
    color: #333;
    text-decoration: none;
    transition: 0.3s ease;
}

.cmm-register-form-wrapper a:hover {
    color: #FF6263;
}

/* 主要容器 */
.cmm-register-form-wrapper .main_wrap {
    max-width: 1200px;
    margin: 0 auto;
}

.cmm-register-form-wrapper .group {
    max-width: 800px;
    min-width: 750px;
    width: 90%;
    padding: 20px 25px;
    background: #fff;
    border-radius: 30px;
    margin: 0 auto;
}

/* 頁面標題 */
.cmm-register-form-wrapper .main-title {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px !important;
    font-weight: 900 !important;
    color: #C39F57 !important;
    margin: 0 !important;
    line-height: 1.2em !important;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

.cmm-register-form-wrapper .main-title img {
    height: 44px;
    transform: translateY(2px);
    margin-right: 5px;
}

.cmm-register-form-wrapper .main-title span {
    color: #C39F57 !important;
    font-weight: 900 !important;
    font-size: inherit !important;
}
.cmm-register-form-wrapper .page_title {
    justify-content: center;
    text-align: center;
    margin-bottom: 30px;
} 

.cmm-register-form-wrapper .page_title h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px !important;
    font-weight: bold !important;
    color: #C39F57 !important;
}

.cmm-register-form-wrapper .page_title h1 img {
    height: 44px;
    transform: translateY(2px);
    margin-right: 5px;
}

/* 表單樣式 */
.cmm-register-form-wrapper .form {
    margin-bottom: 20px;
    border-bottom: 1px solid #ccc;
}

.cmm-register-form-wrapper .form:last-child {
    margin-bottom: 0;
    border: none;
}

.cmm-register-form-wrapper .form .box {
    max-width: 750px;
    width: 100%;
    margin: 0 auto;
}

.cmm-register-form-wrapper .form .bg_box {
    max-width: none;
    padding: 20px;
    margin-bottom: 20px;
    background: #f5f5f5;
    border-radius: 25px;
}

.cmm-register-form-wrapper .form .bg_box .btn_wrap {
    margin-bottom: 0;
    display: flex;
    justify-content: center;
}

.cmm-register-form-wrapper .form .bg_box .btn_wrap .btn {
    width: 40% !important;
    min-width: auto !important;
    flex: none !important;
}

.cmm-register-form-wrapper .form .notice {
    font-size: 14px;
    text-align: right;
    margin-bottom: 20px;
}

.cmm-register-form-wrapper .form .notice i {
    font-style: normal;
    color: #f00;
    font-size: 20px;
}

/* 表單項目 */
.cmm-register-form-wrapper .form .form_item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.cmm-register-form-wrapper .form .form_item.justify_center {
    justify-content: center;
}

.cmm-register-form-wrapper .form .form_item.justify_center > span,
.cmm-register-form-wrapper .form .form_item.justify_center strong {
    margin: 0 10px;
}

.cmm-register-form-wrapper .form .form_item.pass p {
    position: relative;
}

.cmm-register-form-wrapper .form .form_item.pass input {
    padding-right: 50px;
}

.cmm-register-form-wrapper .form .form_item.pass a {
    opacity: 0.5;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

.cmm-register-form-wrapper .form .form_item.pass a.active {
    opacity: 1;
}

.cmm-register-form-wrapper .form .form_item.pass a img {
    width: 20px;
}

.cmm-register-form-wrapper .form .form_item.birth p,
.cmm-register-form-wrapper .form .form_item.birth p > span,
.cmm-register-form-wrapper .form .form_item.gift p,
.cmm-register-form-wrapper .form .form_item.gift p > span {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.cmm-register-form-wrapper .form .form_item.birth select,
.cmm-register-form-wrapper .form .form_item.gift select {
    margin-right: 10px;
    border: 1px solid #999;
    text-align: left;
    font-size: 16px;
    font-weight: normal;
    height: 40px;
    padding: 0 5px;
    border-radius: 10px;
    background: #fff;
}

.cmm-register-form-wrapper .form .form_item.gift > span {
    width: 180px;
    min-width: 180px;
}

.cmm-register-form-wrapper .form .form_item.gift p {
    width: calc(100% - 200px);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cmm-register-form-wrapper .form .form_item.gift p span {
    flex: 1;
    min-width: 120px;
}

.cmm-register-form-wrapper .form .form_item.gift p span select {
    width: 100%;
}

.cmm-register-form-wrapper .form .form_item.flex {
    justify-content: flex-start;
}

.cmm-register-form-wrapper .form .form_item.flex > span {
    min-width: 170px;
    text-align: left;
    margin-right: 15px;
}

.cmm-register-form-wrapper .form .form_item.flex p {
    width: 100%;
    margin-right: 10px;
}

.cmm-register-form-wrapper .form .form_item.code p {
    width: 60% !important;
    margin-right: 10px;
}

.cmm-register-form-wrapper .form .form_item.flex .notice {
    min-width: 100px;
    font-size: 14px;
    color: #f00;
}

.cmm-register-form-wrapper .form .form_item.code > span {
    min-width: 110px;
    margin-right: 15px;
}

.cmm-register-form-wrapper .form .form_item.code .btn {
    min-width: 150px;
    margin-left: 15px;
}

.cmm-register-form-wrapper .form .form_item > span {
    width: 110px;
    text-align: right;
    line-height: 1.2em;
}

.cmm-register-form-wrapper .form .form_item > span i {
    font-style: normal;
    color: #f00;
}

.cmm-register-form-wrapper .form .form_item > span .en {
    width: 100%;
    font-size: 14px;
    letter-spacing: 0;
}

.cmm-register-form-wrapper .form .form_item p {
    width: calc(100% - 130px);
}

.cmm-register-form-wrapper .form .form_item input[type=text],
.cmm-register-form-wrapper .form .form_item input[type=number],
.cmm-register-form-wrapper .form .form_item input[type=password],
.cmm-register-form-wrapper .form .form_item input[type=email],
.cmm-register-form-wrapper .form .form_item input[type=month],
.cmm-register-form-wrapper .form .form_item select,
.cmm-register-form-wrapper .form .form_item textarea {
    width: 100%;
    height: 40px;
    padding: 0 5px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #999;
}

.cmm-register-form-wrapper .form .form_item input[type=text]::-webkit-input-placeholder,
.cmm-register-form-wrapper .form .form_item input[type=number]::-webkit-input-placeholder,
.cmm-register-form-wrapper .form .form_item input[type=password]::-webkit-input-placeholder,
.cmm-register-form-wrapper .form .form_item input[type=email]::-webkit-input-placeholder,
.cmm-register-form-wrapper .form .form_item select::-webkit-input-placeholder,
.cmm-register-form-wrapper .form .form_item textarea::-webkit-input-placeholder {
    font-size: 15px;
}

.cmm-register-form-wrapper .form .form_item textarea {
    height: 150px;
}

/* 按鈕樣式 */
.cmm-register-form-wrapper .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    padding: 9px 10px 11px 10px;
    line-height: 1.3em;
    background: #C39F57;
    border: 1px solid #C39F57;
    border-radius: 10px;
    color: #fff !important;
    font-size: 20px;
    cursor: pointer;
    text-align: center;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

.cmm-register-form-wrapper .btn.grey {
    background: #9A9A9A;
    border-color: #9A9A9A;
}

.cmm-register-form-wrapper .btn.grey_dk {
    background: #595959;
    border-color: #595959;
}

.cmm-register-form-wrapper .btn.red {
    background: #f00;
    border-color: #f00;
}

.cmm-register-form-wrapper .btn.red:hover {
    background: #C39F57;
    border-color: #C39F57;
}

.cmm-register-form-wrapper .btn:hover {
    background: #f00;
    border-color: #f00;
    color: #fff !important;
}

.cmm-register-form-wrapper .btn img {
    margin-right: 10px;
}

.cmm-register-form-wrapper .send_btn_wrap {
    display: flex;
    justify-content: center;
    align-items: center;
}

.cmm-register-form-wrapper .send_btn_wrap .btn {
    width: 250px;
    height: 50px;
}

/* 同意條款 */
.cmm-register-form-wrapper .agree_box {
    padding: 20px 0;
    margin-bottom: 20px;
}

.cmm-register-form-wrapper .agree_box label {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.cmm-register-form-wrapper .agree_box label input[type=checkbox] {
    width: 15px;
    height: 15px;
    margin-right: 10px;
}

.cmm-register-form-wrapper .agree_box label a {
    border-bottom: 1px solid #999;
}

/* 說明文字 */
.cmm-register-form-wrapper .form .text {
    margin-bottom: 15px;
    font-size: 15px;
    line-height: 1.5em;
}

/* 錯誤訊息 */
.cmm-register-form-wrapper .cmm-error {
    color: #721c24 !important;
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
    border: 1px solid #f5c6cb;
    background: #f8d7da;
}

/* 模態框樣式 - 基於 sports-id-form.php 的工作模式 */
.overlay_wrap {
    opacity: 0;
    visibility: hidden;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 999999;
    width: 100%;
    height: 100%;
    overflow: hidden;
    overflow-y: auto;
    transform: scale(0);
    transition: 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* 確保會員條款modal正確隱藏 */
#terms_overlay_wrap {
    display: none;
    opacity: 0;
    visibility: hidden;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 999999;
    width: 100%;
    height: 100%;
    overflow: hidden;
    overflow-y: auto;
    transform: scale(0);
    transition: 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* 顯示modal時 */
#terms_overlay_wrap.trans {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: scale(1) !important;
}

/* 模態框背景 */
.overlay_bg {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1;
}

.overlay_wrap.trans {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.overlay_content {
    opacity: 0;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 10;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    box-sizing: border-box;
    transition: opacity 0.3s ease;
    pointer-events: none;
    cursor: default;
}

/* 確保trans狀態下content立即可見 */
.overlay_wrap.trans .overlay_content {
    opacity: 1 !important;
    pointer-events: auto;
}

.overlay_flex {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

.overlay_box {
    position: relative;
    z-index: 2;
    pointer-events: auto;
    width: 90%;
    max-width: 640px;
    margin: 0 auto;
}

.overlay_box .group {
    margin: 0 auto;
    padding: 30px;
    padding-bottom: 10px;
    border-radius: 30px;
    background: #fff;
    position: relative;
}

.overlay_box .group .page_title {
    justify-content: center;
    text-align: center;
    margin-bottom: 30px;
}

.overlay_box .group .page_title h2 {
    color: #C39F57 !important;
    font-size: 24px !important;
    margin: 0 !important;
    font-weight: bold !important;
}

.overlay_close_btn {
    position: absolute;
    right: 15px;
    top: 15px;
    z-index: 30;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    box-sizing: border-box;
    background: #C39F57;
    background-size: contain;
}

.overlay_close_btn:before {
    content: '×';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
}

.overlay_box .number_list {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    margin-bottom: 30px;
}

.overlay_box .number_list .box {
    width: 100%;
}

.overlay_box .number_list .item {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    position: relative;
    margin-bottom: 15px;
}

.overlay_box .number_list .item:last-child {
    margin-bottom: 0;
}

.overlay_box .number_list .item i {
    width: 25px;
    height: 25px;
    margin-right: 10px;
    line-height: 1.1em;
    font-size: 20px;
    font-style: normal;
    font-weight: bold;
    border-radius: 50%;
    background: #f00;
    color: #fff;
    text-align: center;
    flex-shrink: 0;
    transform: translateY(2px);
}

.overlay_box .number_list .item .in_box {
    width: calc(100% - 35px);
    line-height: 1.5em;
}

.overlay_box .number_list .item .in_box h3,
.overlay_box .number_list .item .in_box p {
    margin-bottom: 10px;
}

.overlay_box .number_list .item .in_box h3 span.bwn {
    color: #C39F57 !important;
}

.overlay_box .number_list .item .in_box .btn_wrap {
    justify-content: flex-start;
    margin-bottom: 20px;
}

.overlay_box .number_list .item .in_box .btn {
    width: auto;
    font-size: 16px;
}

.overlay_box .number_list .item .in_box img {
    max-width: 100%;
}

/* 會員條款模態框樣式 */
.overlay_box.overlay_terms {
    max-width: 800px;
    width: 95%;
}

.overlay_box.overlay_terms .terms {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 10px;
}

.overlay_box.overlay_terms .terms .box {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 10px;
    background: #f9f9f9;
}

.overlay_box.overlay_terms .terms .box:last-child {
    margin-bottom: 0;
}

.overlay_box.overlay_terms .terms .box h3 {
    color: #C39F57 !important;
    font-size: 18px !important;
    font-weight: bold !important;
    margin-bottom: 15px !important;
    border-bottom: 2px solid #C39F57;
    padding-bottom: 8px;
}

.overlay_box.overlay_terms .terms .box p {
    line-height: 1.6em;
    margin-bottom: 10px !important;
    color: #333;
}

.overlay_box.overlay_terms .terms .box ol,
.overlay_box.overlay_terms .terms .box ul {
    margin: 10px 0;
    padding-left: 20px;
}

.overlay_box.overlay_terms .terms .box ol li,
.overlay_box.overlay_terms .terms .box ul li {
    line-height: 1.6em;
    margin-bottom: 8px;
    color: #333;
}

.overlay_box.overlay_terms .terms .box ol li strong,
.overlay_box.overlay_terms .terms .box ul li strong {
    color: #C39F57;
    font-weight: bold;
}

.overlay_box.overlay_terms .terms .box ul ul,
.overlay_box.overlay_terms .terms .box ol ul {
    margin: 5px 0;
    padding-left: 15px;
}

/* 滾動條樣式 */
.overlay_box.overlay_terms .terms::-webkit-scrollbar {
    width: 8px;
}

.overlay_box.overlay_terms .terms::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.overlay_box.overlay_terms .terms::-webkit-scrollbar-thumb {
    background: #C39F57;
    border-radius: 4px;
}

.overlay_box.overlay_terms .terms::-webkit-scrollbar-thumb:hover {
    background: #a88744;
}

/* Body lock 機制 - 防止背景滾動 */
html.lock,
body.lock {
    overflow: hidden !important;
    position: fixed !important;
    height: 100% !important;
}

/* 強化樣式優先級，避免WordPress主題覆蓋 - 移動到 media query 之前 */
div.cmm-register-form-wrapper div.main_wrap.member_join.member_join_3 div.group div.page_title h1 {
    color: #C39F57 !important;
    font-size: 40px !important;
    font-weight: bold !important;
    margin: 0 !important;
}

div.cmm-register-form-wrapper div.main_wrap.member_join.member_join_3 div.group div.form div.box div.form_item span {
    width: 110px !important;
    text-align: right !important;
    line-height: 1.2em !important;
    font-size: 18px !important;
}

div.cmm-register-form-wrapper div.main_wrap.member_join.member_join_3 div.group div.form div.box div.form_item span .en {
    font-size: 14px !important;
    letter-spacing: 0 !important;
}

div.cmm-register-form-wrapper div.main_wrap.member_join.member_join_3 div.group div.form div.box div.form_item input,
div.cmm-register-form-wrapper div.main_wrap.member_join.member_join_3 div.group div.form div.box div.form_item select,
div.cmm-register-form-wrapper div.main_wrap.member_join.member_join_3 div.group div.form div.box div.form_item textarea {
    width: 100% !important;
    height: 40px !important;
    padding: 0 5px !important;
    border-radius: 10px !important;
    background: #fff !important;
    border: 1px solid #999 !important;
}

div.cmm-register-form-wrapper div.main_wrap.member_join.member_join_3 div.group div.form div.agree_box label {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
}

div.cmm-register-form-wrapper div.main_wrap.member_join.member_join_3 div.group div.form div.send_btn_wrap button.btn:hover {
    background: #f00 !important;
    border-color: #f00 !important;
    color: #fff !important;
}

/* 簡訊驗證碼輸入框寬度調整 - 高優先級 */
div.cmm-register-form-wrapper div.main_wrap.member_join.member_join_3 div.group div.form div.box div.form_item.code p {
    width: 60% !important;
    margin-right: 10px !important;
}

/* 手機版時覆蓋簡訊驗證碼輸入框寬度 */
@media screen and (max-width: 450px) {
    div.cmm-register-form-wrapper div.main_wrap.member_join.member_join_3 div.group div.form div.box div.form_item.code p {
        width: 100% !important;
        margin-right: 0 !important;
    }
}

/* 響應式設計 */
@media screen and (max-width: 450px) {
    .cmm-register-form-wrapper .form .form_item {
        align-items: flex-start;
        flex-direction: column;
    }
    
    .cmm-register-form-wrapper .form .form_item.justify_center {
        align-items: center;
    }
    
    .cmm-register-form-wrapper .form .form_item.justify_center > span {
        text-align: center;
    }
    
    .cmm-register-form-wrapper .form .form_item.code .btn {
        width: 100% !important;
        margin-top: 15px !important;
        margin-left: 0 !important;
    }
    
    .cmm-register-form-wrapper .form .form_item > span,
    .cmm-register-form-wrapper .form .form_item p {
        width: 100% !important;
    }
    
    /* 確保簡訊驗證碼輸入框在手機版也是100%寬度 - 使用高優先級選擇器 */
    div.cmm-register-form-wrapper div.main_wrap.member_join.member_join_3 div.group div.form div.box div.form_item.code p {
        width: 100% !important;
        margin-right: 0 !important;
    }
    
    .cmm-register-form-wrapper .form .form_item.gift p {
        flex-direction: column;
        gap: 15px;
    }
    
    .cmm-register-form-wrapper .form .form_item.gift p span {
        min-width: 100%;
    }
    
    .cmm-register-form-wrapper .form .form_item > span {
        margin-bottom: 10px;
        text-align: left;
    }
    
    .cmm-register-form-wrapper .form .form_item > span br {
        display: none;
    }
    
    .cmm-register-form-wrapper .form .form_item > span .en {
        display: inline-block;
        margin-left: 5px;
    }
    
    .cmm-register-form-wrapper .send_btn_wrap .btn {
        width: 100%;
    }
    
    .cmm-register-form-wrapper .form .bg_box .btn_wrap .btn {
        width: auto !important;
    }
    
    .cmm-register-form-wrapper .group {
        min-width: auto;
        width: 95%;
        padding-left: 15px;
        padding-right: 15px;
    }

    div.cmm-register-form-wrapper div.main_wrap.member_join.member_join_3 div.group div.form div.box div.form_item {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    div.cmm-register-form-wrapper div.main_wrap.member_join.member_join_3 div.group div.form div.box div.form_item span {
        width: 100% !important;
        text-align: left !important;
        line-height: 1.2em !important;
        font-size: 16px !important;
        margin-bottom: 10px !important;
    }

    div.cmm-register-form-wrapper div.main_wrap.member_join.member_join_3 div.group div.form div.box div.form_item p {
        width: 100% !important;
    }

    .cmm-register-form-wrapper .main-title {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 26px !important;
        font-weight: 900 !important;
        color: #C39F57 !important;
        margin: 0 !important;
        line-height: 1.2em !important;
        text-rendering: optimizeLegibility;
        -webkit-font-smoothing: antialiased;
    }
}

@media screen and (max-width: 400px) {
    .cmm-register-form-wrapper .page_title h1 {
        flex-direction: column;
    }
    
    .cmm-register-form-wrapper .page_title h1 img {
        margin-bottom: 5px;
    }
}