/* 會員下拉選單位置修正 */
.user-section {
    position: relative;
}

.user-section .dropdown-menu {
    position: absolute;
    right: 0;
    left: auto;
    top: 100%;
    margin-top: 10px;
    min-width: 160px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1050;
}

.user-section .dropdown-item {
    font-size: 1.5rem;
    padding: 10px 20px;
}

.user-section .dropdown-toggle {
    cursor: pointer;
}

.user-section .dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.255em;
    vertical-align: 0.255em;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

/* 手機版選單會員區域 */
.mobile-menu-user {
    padding: 20px;
    background: #f8f9fa;
}

.mobile-user-info .mobile-login-btn {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #000000;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1.6rem;
    font-weight: 500;
    transition: background 0.3s;
}

.mobile-user-info .mobile-login-btn:hover {
    background: #333333;
    color: #fff;
}

.mobile-user-info .mobile-login-btn i {
    margin-right: 10px;
    font-size: 2rem;
}

.mobile-user-welcome {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 1.6rem;
    font-weight: 500;
    color: #333;
}

.mobile-user-welcome i {
    margin-right: 10px;
    font-size: 2.4rem;
    color: #007bff;
}

.mobile-user-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-user-menu li {
    margin-bottom: 5px;
}

.mobile-user-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #fff;
    color: #333;
    border-radius: 6px;
    text-decoration: none;
    font-size: 1.5rem;
    transition: background 0.3s;
}

.mobile-user-menu li a:hover {
    background: #e9ecef;
    color: #333;
}

.mobile-user-menu li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    color: #666;
}

.mobile-menu-divider {
    height: 1px;
    background: #ddd;
    margin: 20px 0;
}

/* ========== 登入/註冊頁面共用樣式 ========== */

/* 登入容器 */
.login-container,
.register-container {
    min-height: calc(100vh - 400px);
    padding: 60px 0;
    margin-top: -6rem;
}

/* 登入/註冊表單盒子 */
.login-box {
    max-width: 500px;
    margin: 0 auto;
    background: #fff;
    padding: 4rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.register-box {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    padding: 4rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.login-box h2,
.register-box h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: #000;
    font-size: 2.8rem;
}

/* 表單群組 */
.login-container .form-group,
.register-container .form-group {
    margin-bottom: 2rem;
}

.login-container .form-group label,
.register-container .form-group label {
    font-size: 2rem;
    font-weight: 600;
    color: #000;
    margin-bottom: 0.8rem;
    display: block;
}

.register-container .form-group label .required {
    color: #dc3545;
    margin-left: 3px;
}

/* 表單控制項 */
.login-container .form-control,
.register-container .form-control {
    height: 4.5rem;
    font-size: 2rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem 1.5rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.login-container .form-control:focus,
.register-container .form-control:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
    outline: none;
}

/* 登入/註冊按鈕 */
.btn-login,
.btn-register {
    width: 100%;
    height: 5rem;
    font-size: 2rem;
    font-weight: 600;
    background-color: #dc3545;
    border: none;
    border-radius: 4px;
    color: #fff;
    margin-top: 2rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-login:hover,
.btn-register:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* 表單核取方塊 */
.login-container .form-check,
.register-container .form-check {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.register-container .form-check {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.login-container .form-check-label,
.register-container .form-check-label {
    font-size: 2rem;
    color: #666;
}

.register-container .form-check-input {
    margin-top: 5px;
}

/* 註冊/登入連結 */
.register-link,
.login-link {
    text-align: center;
    margin-top: 2rem;
    font-size: 2rem;
    color: #666;
}

.register-link a,
.login-link a {
    color: #dc3545;
    text-decoration: none;
    font-weight: 600;
}

.register-link a:hover,
.login-link a:hover {
    text-decoration: underline;
}

/* 密碼切換 */
.password-toggle {
    position: relative;
}

.password-toggle .toggle-icon {
    position: absolute;
    right: 1.5rem;
    top: 5rem;
    cursor: pointer;
    color: #999;
    font-size: 2rem;
    transition: color 0.3s;
}

.password-toggle .toggle-icon:hover {
    color: #dc3545;
}

/* 忘記密碼連結 */
.forgot-password {
    text-align: right;
    margin-top: 1rem;
}

.forgot-password a {
    color: #dc3545;
    font-size: 1.6rem;
    text-decoration: none;
    font-weight: 500;
}

.forgot-password a:hover {
    text-decoration: underline;
}

/* 表單提示文字 */
.form-text {
    font-size: 1.6rem;
    color: #999;
    margin-top: 0.5rem;
}

/* 錯誤訊息 */
.invalid-feedback {
    display: block;
    font-size: 1.6rem;
    color: #dc3545;
    margin-top: 0.5rem;
}

.is-invalid {
    border-color: #dc3545 !important;
}

/* 警告訊息 */
.login-container .alert,
.register-container .alert {
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 4px;
    font-size: 2rem;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* 社交登入區域 */
.social-login {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 1px solid #eee;
}

.register-container .social-login {
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid #eee;
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

.social-login-title {
    text-align: center;
    font-size: 2rem;
    color: #999;
    margin-bottom: 2rem;
    font-weight: 500;
}

.social-login-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.register-container .social-login-buttons {
    display: block;
    margin-bottom: 3rem;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem 2rem;
    border-radius: 4px;
    font-size: 2rem;
    font-weight: 500;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: #fff;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: #fff;
}

.social-btn i {
    margin-right: 0.8rem;
    font-size: 2rem;
}

.social-btn.google {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
}

.social-btn.google:hover {
    background: #f8f9fa;
    color: #333;
    border-color: #999;
}

.social-btn.facebook {
    background: #1877f2;
    border-color: #1877f2;
}

.social-btn.facebook:hover {
    background: #0d6efd;
}

.social-btn.line {
    background: #06c755;
    border-color: #06c755;
}

.social-btn.line:hover {
    background: #05b54a;
}

.social-btn.apple {
    background: #000;
    border-color: #000;
}

.social-btn.apple:hover {
    background: #333;
}

/* 分隔線 */
.divider {
    text-align: center;
    margin: 3rem 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: #eee;
}

.divider span {
    position: relative;
    background: #fff;
    padding: 0 1.5rem;
    color: #999;
    font-size: 2rem;
    font-weight: 500;
}

/* 響應式設計 */
@media (max-width: 992px) {
    .login-container,
    .register-container {
        margin-top: -6rem;
    }
}

@media (max-width: 768px) {
    .login-container,
    .register-container {
        padding: 4rem 0;
    }

    .login-box,
    .register-box {
        padding: 3rem 2rem;
        margin: 0 1.5rem;
    }

    .login-box h2,
    .register-box h2 {
        font-size: 2.4rem;
    }

    .social-login-buttons {
        grid-template-columns: 1fr;
    }
}
