/* ===== ����]�w ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

/* ===== �n�J�e�� ===== */
.login-container {
    display: flex;
    min-height: 100vh;
}

/* ===== 左側 - 品牌區域 ===== */
.login-left {
    flex: 1;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
}

    .login-left::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
        background-size: 50px 50px;
        animation: backgroundMove 20s linear infinite;
        z-index: 2;
    }

@keyframes backgroundMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

/* 背景圖片層 */
.login-left-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

/* 半透明遮罩層 */
.login-left-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.88) 0%, rgba(56, 142, 60, 0.92) 100%);
    z-index: 1;
}

.brand-section {
    position: relative;
    z-index: 3;
    max-width: 500px;
}

.brand-logo {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease;
}

.brand-name {
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -2px;
    font-family: 'Georgia', 'Times New Roman', serif;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    line-height: 1.1;
}

.welcome-title {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 15px;
    animation: fadeInLeft 0.8s ease 0.2s backwards;
}

.welcome-subtitle {
    font-size: 18px;
    opacity: 0.95;
    margin-bottom: 50px;
    line-height: 1.8;
    animation: fadeInLeft 0.8s ease 0.4s backwards;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 16px;
    animation: fadeInLeft 0.8s ease backwards;
}

    .feature-item:nth-child(1) {
        animation-delay: 0.6s;
    }

    .feature-item:nth-child(2) {
        animation-delay: 0.7s;
    }

    .feature-item:nth-child(3) {
        animation-delay: 0.8s;
    }

    .feature-item:nth-child(4) {
        animation-delay: 0.9s;
    }

    .feature-item i {
        font-size: 24px;
        color: rgba(255,255,255,0.9);
    }

/* ===== �k�� - �n�J���� ===== */
.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: white;
}

.login-form-container {
    width: 100%;
    max-width: 480px;
    animation: fadeInRight 0.8s ease;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 30px;
    transition: all 0.3s;
}

    .back-link:hover {
        color: #4caf50;
        gap: 12px;
    }

    .back-link i {
        font-size: 16px;
    }

.form-wrapper {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.form-title {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.form-subtitle {
    font-size: 15px;
    color: #666;
    margin-bottom: 35px;
}

/* ===== ���椸�� ===== */
.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

    .form-label i {
        color: #4caf50;
        font-size: 16px;
    }

.form-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
    background: #fafafa;
}

    .form-input:focus {
        outline: none;
        border-color: #4caf50;
        background: white;
        box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
    }

    .form-input::placeholder {
        color: #aaa;
    }

/* �K�X��J�� */
/* 國內遊客登入：+86 固定 + 本地手機 */
.login-phone-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    width: 100%;
}

.login-country-code {
    flex: 0 0 auto;
    width: 4.75rem;
    max-width: 26%;
    text-align: center;
    padding-left: 10px;
    padding-right: 10px;
    cursor: default;
    background: #ececec !important;
    color: #555;
}

    .login-country-code:focus {
        outline: none;
        border-color: #e0e0e0;
        box-shadow: none;
        background: #ececec !important;
    }

.login-country-local {
    flex: 1 1 auto;
    min-width: 0;
}

.password-input-wrapper {
    position: relative;
}

    .password-input-wrapper .form-input {
        padding-right: 50px;
    }

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    transition: color 0.3s;
    padding: 5px;
}

    .toggle-password:hover {
        color: #4caf50;
    }

/* 表單選項 */
.form-options {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 30px;
    font-size: 14px;
}

.forgot-link {
    color: #4caf50;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

    .forgot-link:hover {
        color: #388e3c;
    }

/* ⭐ 國內版：遊客登入切換連結 */
.guest-login-link {
    color: #4caf50;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
    white-space: nowrap;
}

    .guest-login-link:hover {
        color: #388e3c;
        text-decoration: none;
        transform: translateX(3px);
    }

    .guest-login-link i {
        font-size: 12px;
        transition: transform 0.3s;
    }

    .guest-login-link:hover i {
        transform: translateX(2px);
    }

/* ������s */
.btn-submit {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

    .btn-submit:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
    }

    .btn-submit:active {
        transform: translateY(0);
    }

/* ���j�u */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 30px 0;
    color: #999;
    font-size: 14px;
}

    .divider::before,
    .divider::after {
        content: '';
        flex: 1;
        border-bottom: 1px solid #e0e0e0;
    }

    .divider span {
        padding: 0 15px;
    }

/* ���s�n�J */
.social-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

    .social-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

.google-btn {
    color: #db4437;
}

    .google-btn:hover {
        border-color: #db4437;
        background: #fff8f7;
    }

.facebook-btn {
    color: #1877f2;
}

    .facebook-btn:hover {
        border-color: #1877f2;
        background: #f0f7ff;
    }

.social-btn i {
    font-size: 18px;
}

/* ���U�϶� */
.register-section {
    text-align: center;
    font-size: 14px;
    color: #666;
}

.register-link {
    color: #4caf50;
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
    transition: color 0.3s;
}

    .register-link:hover {
        color: #388e3c;
        text-decoration: underline;
    }

/* ⭐ 遊客模式：會員登入連結（與註冊連結相同樣式） */
.member-login-link {
    color: #4caf50;
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
    transition: color 0.3s;
}

    .member-login-link:hover {
        color: #388e3c;
        text-decoration: underline;
    }

    .member-login-link i {
        margin-right: 4px;
    }

.separator {
    color: #ccc;
    margin: 0 8px;
    font-weight: normal;
}

/* ������T */
.login-footer {
    margin-top: 30px;
    text-align: center;
    font-size: 12px;
    color: #999;
}

    .login-footer a {
        color: #4caf50;
        text-decoration: none;
    }

        .login-footer a:hover {
            text-decoration: underline;
        }

/* ===== �ʵe�ĪG ===== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== �T�����]�p ===== */
@media (max-width: 1024px) {
    .login-left {
        padding: 40px;
    }

    .brand-logo {
        font-size: 40px;
    }

    .brand-name {
        font-size: 40px;
    }

    .welcome-title {
        font-size: 36px;
    }

    .welcome-subtitle {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
    }

    .login-left {
        display: none;
    }

    .login-right {
        padding: 30px 20px;
        width: 100%;
    }

    .form-wrapper {
        padding: 30px 25px;
    }

    .form-title {
        font-size: 26px;
    }

    .social-login {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .login-left {
        display: none;
    }

    .login-right {
        padding: 20px 15px;
    }

    .brand-logo {
        font-size: 32px;
        gap: 10px;
    }

        .brand-logo i {
            font-size: 36px;
        }

    .brand-name {
        font-size: 32px;
    }

    .welcome-title {
        font-size: 24px;
    }

    .welcome-subtitle {
        font-size: 14px;
    }

    .feature-item {
        font-size: 13px;
    }

        .feature-item i {
            font-size: 20px;
        }

    .form-wrapper {
        padding: 25px 20px;
        box-shadow: none;
    }

    .form-title {
        font-size: 24px;
    }

    .form-subtitle {
        font-size: 14px;
    }

    .form-input {
        padding: 12px 16px;
        font-size: 14px;
    }

    .btn-submit {
        padding: 14px;
        font-size: 15px;
    }


    /* ⭐ 國內版：手機版遊客登入連結樣式調整 */
    .guest-login-link {
        align-self: flex-end;
        font-size: 13px;
    }

    .form-options {
        justify-content: flex-end;
    }
}

/* ===== ���J���A ===== */
.btn-submit.loading {
    pointer-events: none;
    opacity: 0.7;
}

    .btn-submit.loading::after {
        content: '';
        width: 16px;
        height: 16px;
        border: 2px solid rgba(255,255,255,0.3);
        border-top-color: white;
        border-radius: 50%;
        animation: spin 0.6s linear infinite;
        margin-left: 10px;
    }

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== ���~���A ===== */
.form-input.error {
    border-color: #f44336;
    background: #fff5f5;
}

    .form-input.error:focus {
        box-shadow: 0 0 0 4px rgba(244, 67, 54, 0.1);
    }

.error-message {
    color: #f44336;
    font-size: 13px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .error-message i {
        font-size: 14px;
    }

/* ===== ���\���A ===== */
.form-input.success {
    border-color: #4caf50;
}

.success-message {
    color: #4caf50;
    font-size: 13px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===== �L��ê�]�p ===== */
.form-input:focus-visible,
.btn-submit:focus-visible,
.social-btn:focus-visible {
    outline: 3px solid #4caf50;
    outline-offset: 2px;
}

/* ===== �C�L�˦� ===== */
@media print {
    .login-left,
    .social-login,
    .login-footer {
        display: none;
    }
}

/* Alert styles */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    animation: fadeIn 0.3s ease;
}

.alert-danger {
    background: #fff5f5;
    color: #f44336;
    border: 1px solid #ffcdd2;
}

.alert i {
    font-size: 18px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}
