.login-box {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 40px 35px;
    position: relative;
}

/**************************************************************/

/* ========================================
   商户信息展示
   ======================================== */

.merchant-info {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: #6c757d;
    display: inline-block;
    font-size: 0.95rem;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
}

.merchant-info::before {
    content: "🏢 ";
    margin-right: 0.25rem;
}

/* ========================================
   登录方式选择器
   ======================================== */

.login-method-selector {
    animation: fadeInUp 0.5s ease;
    margin-bottom: 1.5rem;
}

.login-method-selector .btn-group {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    width: 100%;
}

.login-method-selector .btn {
    border: none;
    font-weight: 500;
    overflow: hidden;
    padding: 0.875rem;
    position: relative;
    transition: var(--transition);
}

.login-method-selector .btn-check:checked + .btn {
    background: var(--primary-color);
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    color: white;
}

.login-method-selector .btn-check:checked + .btn::after {
    animation: shimmer 2s infinite;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    content: "";
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }

    100% { transform: translateX(100%); }
}

.login-method-selector .btn i {
    font-size: 1.1rem;
    margin-right: 0.5rem;
}

/*.forgot-password-link {
    color: #6c757d;
    font-size: 0.9rem;
    text-decoration: none;
}
*/

.forgot-password-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.forgot-password-link {
    color: #6c757d;
    font-size: 0.9rem;
    position: relative;
    text-decoration: none;
    transition: var(--transition);
}

.forgot-password-link::after {
    background-color: var(--primary-color);
    bottom: -2px;
    content: "";
    height: 2px;
    left: 50%;
    position: absolute;
    transition: var(--transition);
    width: 0;
}


/**************************************************************/

/* 商户登录的特殊输入样式 */

.merchant-theme .form-control[placeholder*="商户ID"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236c757d' class='bi bi-building' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M14.763.075A.5.5 0 0 1 15 .5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5V14h-1v1.5a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5V10a.5.5 0 0 1 .342-.474L6 7.64V4.5a.5.5 0 0 1 .276-.447l8-4a.5.5 0 0 1 .487.022zM6 8.694L1 10.36V15h5V8.694zM7 15h2v-1.5a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 .5.5V15h2V1.309l-7 3.5V15z'/%3E%3C/svg%3E");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1rem;
    padding-right: 2.5rem;
}

/* ========================================
   登录选项增强
   ======================================== */

.login-options {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin: 1rem 0;
    padding: 0.5rem 0;
}

.login-options .form-check { margin: 0; }

.login-options .form-check-input {
    cursor: pointer;
    height: 1.25rem;
    margin-top: 0.125rem;
    width: 1.25rem;
}

.login-options .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/**************************************************************/


/* Logo */

.login-logo {
    margin-bottom: 35px;
    text-align: center;
}

.login-logo img {
    height: 50px;
    width: auto;
}

.login-logo h1 {
    color: #32325d;
    font-size: 24px;
    font-weight: 600;
    margin-top: 15px;
}

/** Login Switch */

.login-method-switchs {
    display: flex;
    gap: 10px;
    position: absolute;
    right: 5px;
    top: 5px;
}

.switch-mask {
    border-color: transparent transparent transparent var(--bg-card);
    border-style: solid;
    border-width: 50px 0 0 50px;
    cursor: pointer;
    height: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: all .2s;
    width: 0;
}

.switch-image {
    cursor: pointer;
    height: 50px;
    width: 50px;
}

.switch-to-account { display: block; }

.switch-to-qrcode { display: none; }

/* Login Form */

.login-form-wrapper { position: relative; }

.login-method-tabs {
    display: flex;
    gap: 10px;
    position: absolute;
    right: 0;
    top: -30px;
}

.method-tab {
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 6px 12px;
    transition: all 0.3s;
}

.method-tab.active {
    background: var(--bg-light);
    color: var(--primary-color);
}

.method-tab:hover { color: var(--primary-color); }

.method-tab i { margin-right: 5px; }

/* Form Controls */

.form-floating { margin-bottom: 20px; }

.form-floating > .form-control {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    height: 50px;
    padding: 10px 15px;
    transition: all 0.3s;
}

.form-floating > .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(94, 114, 228, 0.25);
}

.form-floating > label {
    color: var(--text-muted);
    font-size: 14px;
    padding: 12px 15px;
}

/* Remember Me  */

.login-options {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
}

.form-check { margin: 0; }

.form-check-input {
    border: 2px solid var(--border-color);
    cursor: pointer;
    height: 18px;
    margin-right: 8px;
    margin-top: 0;
    width: 18px;
}

.form-check-input:checked {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.form-check-label {
    color: #525f7f !important;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
}

/* Submit Button */

.btn-login {
    align-items: center;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: white;
    display: flex;
    font-size: 16px;
    font-weight: 600;
    gap: 10px;
    height: 48px;
    justify-content: center;
    transition: all 0.3s;
    width: 100%;
}

.form-floating small.text-muted {
    bottom: -1.25rem;
    font-size: 0.75rem;
    left: 0.75rem;
    opacity: 0;
    position: absolute;
    transition: opacity 0.3s ease;
}

.form-floating:hover small.text-muted,
.form-floating:focus-within small.text-muted { opacity: 1; }

.btn-login:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px 0 rgba(94, 114, 228, 0.4);
    color: white;
    transform: translateY(-1px);
}

/* External Login Section */

.external-login-divider {
    margin: 30px 0 20px;
    position: relative;
    text-align: center;
}

.external-login-divider span {
    background: white;
    color: var(--text-muted);
    font-size: 13px;
    padding: 0 15px;
    position: relative;
    z-index: 1;
}

.external-login-divider::before {
    background: var(--border-color);
    content: '';
    height: 1px;
    left: 0;
    position: absolute;
    right: 0;
    top: 50%;
}

/* External Login Buttons */

.external-login-buttons {
    display: flex;
    gap: 12px;
}

.btn-external {
    align-items: center;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #525f7f;
    display: flex;
    font-size: 14px;
    font-weight: 500;
    gap: 10px;
    height: 44px;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s;
    width: 100%;
}

.btn-external:hover {
    background: var(--bg-light);
    border-color: #c3c8d0;
    box-shadow: var(--shadow-sm);
    color: #32325d;
    transform: translateY(-1px);
}

.btn-external i {
    font-size: 18px;
    width: 20px;
}

.btn-google i { color: #ea4335; }

.btn-microsoft i { color: #00a4ef; }

.btn-github i { color: #24292e; }

.btn-ad i { color: #0078d4; }

/* QR Code Login */

.qr-login-content {
    display: none;
    height: 269px;
    text-align: center;
}

.qr-login-content.active { display: block; }

.qr-code-wrapper {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    height: 200px;
    margin: 0 auto 12px;
    padding: 10px;
    width: 200px;
}

.qr-code-wrapper img {
    height: 100%;
    width: 100%;
}

.qr-code-wrapper canvas {
    height: 100% !important;
    width: 100% !important;
}

.qr-login-text {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 10px;
}

.qr-login-app-hint {
    color: var(--text-muted);
    font-size: 12px;
}

/* Error Messages */

.validation-summary-errors {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 12px 15px;
}

.validation-summary-errors ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.validation-summary-errors li {
    color: #c53030;
    font-size: 14px;
}

.field-validation-error {
    color: #c53030;
    display: block;
    font-size: 12px;
    margin-top: 5px;
}

/* Loading Spinner */

.spinner-border-sm {
    border-width: 2px;
    height: 16px;
    width: 16px;
}

/* Responsive Design */

@media (max-width: 576px) {
    .login-content-wrapper {
        max-width: 100%;
        padding: 10px;
    }

    .login-box { padding: 30px 20px; }

    .login-logo h1 { font-size: 20px; }

    .method-tab span { display: none; }

    .external-login-divider span { font-size: 12px; }
}
