/* ===== ����]�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;
}

/* ===== ���� - �~�P�ϰ� ===== */
.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.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: backgroundMove 20s linear infinite;
}

@keyframes backgroundMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

.brand-section {
    position: relative;
    z-index: 1;
    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: var(--primary-color);
    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: var(--primary-color);
    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: var(--primary-color);
    background: white;
    box-shadow: var(--shadow-focus);
}

.form-input::placeholder {
    color: #aaa;
}

/* �K�X��J�� */
.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: var(--primary-color);
}

/* ����ﶵ */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-size: 14px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-text {
    color: #666;
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.forgot-link:hover {
    color: var(--primary-dark);
}

/* 忘記帳號/密碼連結組 */
.forgot-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.forgot-links .separator {
    color: #ccc;
    font-size: 14px;
}

/* ������s */
.btn-submit {
    width: 100%;
    padding: 16px;
    background: var(--primary-gradient);
    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: var(--shadow-primary);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-lg);
}

.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: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
    transition: color 0.3s;
}

.register-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ������T */
.login-footer {
    margin-top: 30px;
    text-align: center;
    font-size: 12px;
    color: #999;
}

.login-footer a {
    color: var(--primary-color);
    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;
    }

    .form-options {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

/* ===== ���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: var(--primary-color);
}

.success-message {
    color: var(--primary-color);
    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 var(--primary-color);
    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);
    }
}