/* --- 彈窗背景遮罩 (Modal Overlay) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* 半透明黑背景 */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* 確保在最上層 */
    backdrop-filter: blur(4px); /* 背景模糊效果 */
}

/* --- 彈窗主體 (Modal Content) - 加大版 --- */
.modal-content {
    background-color: #111a24; /* stoXmas 深藍色 */
    padding: 3rem;             /* 增加內距，讓內容不擁擠 (原為 2rem) */
    border-radius: 16px;       /* 稍微增加圓角感 (原為 12px) */
    width: 90%;
    max-width: 550px;          /* 寬度從 400px 提升至 550px */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5); /* 加深陰影層次感 */
    animation: modalFadeIn 0.3s ease-out; 
}

/* --- 標題與文字 --- */
.modal-content h3 {
    margin-top: 0;
    color: #d32f2f; /* stoXmas 經典紅 */
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

/* --- 表單輸入框 --- */
.modal-content input {
    width: 100%;
    padding: 12px;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box; /* 確保 Padding 不會撐破寬度 */
    font-size: 1rem;
    transition: border-color 0.2s;
}

.modal-content input:focus {
    border-color: #d32f2f;
    outline: none;
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.1);
}

.close-modal-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 45px;
    color: #d32f2f; /* stoXmas 經典紅 */
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
}

.switch-form-text {
    text-align: center;
    margin-top: 1rem;
    color: #888;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s;
}

.link-button {
    background: none;
    border: none;
    color: #d32f2f; /* stoXmas 經典紅 */
    font-weight: bold;
    cursor: pointer;
    padding: 0;
}

.link-button:hover {
    color: #b71c1c;
}

.remember-me {
    display: flex;
    gap: 8px;
    color: #888;
    font-size: 0.9rem;
}

.remember-me input:focus {
    border-color: none;
    outline: none;
    box-shadow: none;
}

.remember-me__checkbox {
    width: 16px !important;
    height: 16px;
    margin-right: 8px;
    flex-shrink: 0;
}

.remember-me__checkbox:checked {
    width: 16px;
    height: 16px;
}

/* --- 註冊/登入按鈕 --- */
#btn-register, #btn-login {
    width: 100%;
    padding: 12px;
    background-color: #d32f2f; /* stoXmas 經典紅 */
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

#btn-register:hover, #btn-login:hover {
    background-color: #b71c1c;
}

#btn-register:active, #btn-login:active {
    transform: scale(0.98); /* 點擊按壓感 */
}

.close-modal-button:hover {
    color: #ff7878;
}

/* --- 彈出動畫 --- */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%); /* 從稍微上方開始 */
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* 針對行動裝置微調：確保在手機上不會太大 */
@media (max-width: 600px) {
    .modal-content {
        padding: 2rem;
        max-width: 95%;
    }
}
