/* mTLS客户端证书认证页面样式 */

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --background-color: #f8fafc;
    --card-background: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
}

/* 导航栏 */
.nav-bar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background: var(--primary-color);
    color: white;
}

/* 主容器 */
.login-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.login-box {
    background: var(--card-background);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    margin-top: 2rem;
}

/* 登录头部 */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* 认证状态 */
.auth-status {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border-left: 4px solid var(--success-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.auth-status.hidden {
    display: none;
}

.status-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.status-icon {
    font-size: 2rem;
}

.status-title {
    font-weight: 600;
    color: var(--success-color);
    font-size: 1.1rem;
}

.status-detail {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 表单区域 */
.login-form {
    space-y: 2rem;
}

.form-section {
    margin-bottom: 2rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

/* 认证方式卡片 */
.auth-method {
    margin-bottom: 1.5rem;
}

.method-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    background: #f8fafc;
    transition: all 0.2s;
}

.method-card:hover {
    border-color: var(--primary-color);
    background: #f1f5f9;
}

.method-icon {
    font-size: 2rem;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border-radius: 0.5rem;
}

.method-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.method-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 证书状态 */
.cert-status {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: #f8fafc;
}

.status-checking {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.status-success {
    color: var(--success-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-error {
    color: var(--danger-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 按钮样式 */
.btn-login {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background: white;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 手动操作 */
.manual-actions {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-top: 2rem;
}

.manual-actions h4 {
    margin-bottom: 1rem;
    color: var(--warning-color);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.https-notice {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

.https-notice p {
    margin: 0.5rem 0;
    color: #dc2626;
    font-size: 0.9rem;
}

.https-notice a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.https-notice a:hover {
    text-decoration: underline;
}

/* 证书触发帮助 */
.cert-trigger-help {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
}

.cert-trigger-help h5 {
    margin: 0 0 0.75rem 0;
    color: #0369a1;
    font-size: 1rem;
}

.cert-trigger-help ul {
    margin: 0;
    padding-left: 1.5rem;
}

.cert-trigger-help li {
    margin-bottom: 0.5rem;
    color: #374151;
    font-size: 0.9rem;
    line-height: 1.4;
}

.cert-trigger-help strong {
    color: #0369a1;
}

/* 帮助信息 */
.help-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.help-section h4 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.help-content {
    space-y: 1.5rem;
}

.help-item {
    margin-bottom: 1.5rem;
}

.help-item strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.help-item p,
.help-item ul,
.help-item ol {
    color: var(--text-secondary);
    line-height: 1.6;
}

.help-item ul,
.help-item ol {
    margin-left: 1.5rem;
}

.help-item li {
    margin-bottom: 0.25rem;
}

/* 证书下载区域 */
.certificate-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.certificate-section h4 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.cert-download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.cert-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: #f8fafc;
    transition: all 0.2s;
}

.cert-card:hover {
    border-color: var(--primary-color);
    background: white;
    box-shadow: var(--shadow);
}

.cert-icon {
    font-size: 1.5rem;
    padding: 0.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 0.375rem;
}

.cert-info {
    flex: 1;
}

.cert-info h5 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.cert-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.btn-download {
    padding: 0.5rem 1rem;
    background: var(--success-color);
    color: white;
    text-decoration: none;
    border-radius: 0.375rem;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-download:hover {
    background: #047857;
}

/* 页脚 */
.footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

.footer p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .login-container {
        padding: 1rem;
    }
    
    .login-box {
        padding: 2rem;
    }
    
    .nav-bar {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        justify-content: center;
    }
    
    .cert-download-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .cert-card {
        flex-direction: column;
        text-align: center;
    }
}
