/* ==========================================
   modal.css - 全局弹窗样式
   ========================================== */

/* ==========================================
   登录弹窗 - 现代精致设计
   ========================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at top, rgba(79, 70, 229, 0.15) 0%, rgba(15, 23, 42, 0.7) 100%);
    backdrop-filter: blur(16px) saturate(180%);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 24px;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    display: flex;
    background: #ffffff;
    border-radius: 24px;
    width: 100%;
    max-width: 920px;
    max-height: 88vh;
    overflow: hidden;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    transform: scale(0.92) translateY(30px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.modal-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed, #0ea5e9, #4f46e5);
    background-size: 300% 100%;
    animation: gradientShift 4s ease infinite;
    z-index: 1;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.modal-overlay.show .modal-container {
    transform: scale(1) translateY(0);
}

/* 左侧装饰区域 */
.modal-decoration {
    flex: 0 0 340px;
    background: linear-gradient(180deg, 
        #1e1b4b 0%, 
        #312e81 50%, 
        #4c1d95 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 40px;
    overflow: hidden;
}

.decoration-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.decoration-bg::before,
.decoration-bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
}

.decoration-bg::before {
    width: 300px;
    height: 300px;
    background: #7c3aed;
    top: -100px;
    right: -100px;
    animation: float1 8s ease-in-out infinite;
}

.decoration-bg::after {
    width: 250px;
    height: 250px;
    background: #0ea5e9;
    bottom: -80px;
    left: -80px;
    animation: float2 10s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -20px) scale(1.1); }
    66% { transform: translate(-10px, 10px) scale(0.95); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-30px, -20px) scale(1.15); }
}

.decoration-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.6;
}

.decoration-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
}

.decoration-icon-wrapper {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    position: relative;
}

.decoration-icon-wrapper::before {
    content: '';
    position: absolute;
    inset: -8px;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.05));
    border-radius: 28px;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.decoration-icon {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 
        0 8px 32px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

.decoration-content h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.decoration-content p {
    font-size: 14px;
    opacity: 0.85;
    line-height: 1.6;
    max-width: 260px;
    margin: 0 auto 32px;
}

.decoration-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(255,255,255,0.08);
    border-radius: 14px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.12);
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(255,255,255,0.12);
    transform: translateX(4px);
    border-color: rgba(255,255,255,0.2);
}

.feature-icon-wrapper {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon {
    font-size: 18px;
}

.feature-text {
    font-size: 13px;
    font-weight: 500;
}

/* 右侧表单区域 */
.modal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-height: 88vh;
    overflow-y: auto;
    background: #fafafa;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 32px 36px 0;
}

.modal-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close:hover {
    background: #fee2e2;
    color: #ef4444;
    transform: rotate(90deg) scale(1.1);
}

/* 标签页 */
.modal-tabs {
    display: flex;
    padding: 0 36px;
    margin-top: 24px;
    gap: 8px;
}

.modal-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.modal-tab:hover {
    color: #0f172a;
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-tab.active {
    color: white !important;
    background: var(--gradient-primary-extended);
    background-size: 200% 200%;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.tab-icon {
    font-size: 16px;
}

/* 表单区域 */
.modal-body {
    padding: 28px 36px 36px;
}

.modal-form {
    display: none;
}

.modal-form.active {
    display: block;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(16px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.modal-form .form-group {
    margin-bottom: 18px;
}

.modal-form .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.input-wrapper {
    position: relative;
}

.modal-form .form-group input {
    width: 100%;
    padding: 14px 48px 14px 16px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    color: #0f172a;
    font-size: 15px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.modal-form .form-group input:hover {
    border-color: #cbd5e1;
}

.modal-form .form-group input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    background: #ffffff;
}

.modal-form .form-group input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.input-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #64748b;
}

/* 密码可见性切换 */
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: #f1f5f9;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.toggle-password:hover {
    background: #e2e8f0;
}

.eye-icon {
    font-size: 16px;
}

/* 记住我选项 */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #475569;
    font-weight: 500;
}

.remember-me input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.remember-me:hover .checkmark {
    border-color: #94a3b8;
}

.remember-me input:checked + .checkmark {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.remember-me input:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: 700;
}

/* 表单提示 */
.form-note {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #86efac;
    border-radius: 12px;
    margin-bottom: 22px;
    font-size: 13px;
    color: #166534;
}

.note-icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* 提交按钮 */
.btn-submit {
    position: relative;
    height: 52px;
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

.btn-submit .btn-primary {
    background: var(--gradient-primary-extended);
    background-size: 200% 200%;
    color: white !important;
    border: none;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.02em;
    padding: 16px 48px;
    border-radius: 14px;
    box-shadow: 
        0 4px 16px rgba(79, 70, 229, 0.35),
        0 2px 8px rgba(79, 70, 229, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: gradient-shift 3s ease infinite;
}

.btn-submit .btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 12px 32px rgba(79, 70, 229, 0.5),
        0 4px 12px rgba(79, 70, 229, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-submit .btn-primary:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 
        0 6px 20px rgba(79, 70, 229, 0.4),
        0 2px 6px rgba(79, 70, 229, 0.25);
}

.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-full {
    width: auto;
    min-width: 200px;
}

/* 弹窗响应式 */
@media (max-width: 960px) {
    .modal-decoration {
        display: none;
    }
    
    .modal-container {
        max-width: 480px;
    }
}

@media (max-width: 560px) {
    .modal-overlay {
        padding: 0;
    }
    
    .modal-container {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        margin: 0;
    }
    
    .modal-container::before {
        display: none;
    }
    
    .modal-header {
        padding: 24px 24px 0;
    }
    
    .modal-header h2 {
        font-size: 22px;
    }
    
    .modal-tabs {
        padding: 0 24px;
        margin-top: 20px;
    }
    
    .modal-body {
        padding: 24px;
    }
}

/* ==========================================
   全局确认对话框
   ========================================== */

.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 24px;
}

.confirm-overlay.show {
    opacity: 1;
    visibility: visible;
}

.confirm-dialog {
    background: white;
    border-radius: 20px;
    padding: 32px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.confirm-overlay.show .confirm-dialog {
    transform: scale(1) translateY(0);
}

.confirm-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.confirm-icon.warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.confirm-icon.danger {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
}

.confirm-icon.info {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
}

.confirm-icon.success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
}

.confirm-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
}

.confirm-message {
    font-size: 15px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 28px;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-btn {
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.confirm-btn-cancel {
    background: #f1f5f9;
    color: #64748b;
}

.confirm-btn-cancel:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.confirm-btn-ok {
    background: var(--gradient-primary-extended);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.confirm-btn-ok:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.confirm-btn-ok.danger {
    background: var(--gradient-error);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.confirm-btn-ok.danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

@media (max-width: 560px) {
    .confirm-overlay {
        padding: 0;
    }
    
    .confirm-dialog {
        max-width: 100%;
        border-radius: 0;
        margin: 0;
    }
    
    .confirm-actions {
        flex-direction: column;
    }
}
