:root {
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #4338ca;
    --bg: #f0f2f8;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --error: #ef4444;
    --success: #22c55e;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    --radius: 16px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* 装饰背景圆 */
.bg-circle {
    position: fixed;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}
.bg-circle:nth-child(1) {
    width: 400px;
    height: 400px;
    top: -150px;
    right: -100px;
    animation: float 8s ease-in-out infinite;
}
.bg-circle:nth-child(2) {
    width: 300px;
    height: 300px;
    bottom: -100px;
    left: -80px;
    animation: float 10s ease-in-out infinite reverse;
}
.bg-circle:nth-child(3) {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 60%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-30px) scale(1.05);
    }
}

.login-wrapper {
    width: 100%;
    max-width: 460px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 48px 40px 40px;
    box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

/* 机构图标（后台上传） */
.login-logo {
    text-align: center;
    margin-bottom: 24px;
}
.login-logo img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Logo / 标题区 */
.login-header {
    text-align: center;
    margin-bottom: 36px;
}
.login-header .icon-wrap {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.3);
}
.login-header .icon-wrap svg {
    width: 32px;
    height: 32px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.login-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}
.login-header p {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 6px;
}

/* 标签切换 */
.tab-switch {
    display: flex;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 32px;
}
.tab-btn {
    flex: 1;
    padding: 12px 18px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.tab-btn.active {
    background: #fff;
    color: var(--primary);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.tab-btn:hover:not(.active) {
    color: var(--text);
}

/* 表单 */
.form-panel {
    display: none;
    animation: fadeSlideIn 0.35s ease;
}
.form-panel.active {
    display: block;
}

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

.form-group {
    margin-bottom: 20px;
    position: relative;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}
.input-field {
    position: relative;
    display: flex;
    align-items: center;
}
.input-field input {
    width: 100%;
    padding: 14px 16px;
    padding-left: 44px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    color: var(--text);
    background: #f8fafc;
    transition: var(--transition);
    outline: none;
    font-family: inherit;
}
.input-field input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
}
.input-field input.error {
    border-color: var(--error);
    background: #fef2f2;
}
.input-field .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #94a3b8;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
    transition: var(--transition);
}
.input-field input:focus~.input-icon,
.input-field input:focus+.input-icon {
    stroke: var(--primary);
}

/* 短信验证码行 */
.sms-row {
    display: flex;
    gap: 12px;
}
.sms-row .input-field {
    flex: 1;
}
.sms-btn {
    flex-shrink: 0;
    min-width: 120px;
    padding: 14px 16px;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: inherit;
}
.sms-btn:hover {
    background: var(--primary);
    color: #fff;
}
.sms-btn:disabled {
    border-color: #cbd5e1;
    color: #94a3b8;
    background: #f1f5f9;
    cursor: not-allowed;
}
.sms-btn.counting {
    border-color: var(--border);
    color: var(--text-light);
    background: #f1f5f9;
}

.error-msg {
    font-size: 12px;
    color: var(--error);
    margin-top: 4px;
    display: none;
    align-items: center;
    gap: 4px;
}
.error-msg.show {
    display: flex;
}

/* 按钮 */
.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.5px;
    margin-top: 8px;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
    font-family: inherit;
}
.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(79, 70, 229, 0.4);
}
.submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}
.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 其他选项 */
.extra-links {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-light);
}
.extra-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}
.extra-links a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-light);
    font-size: 12px;
}
.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Toast */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    background: var(--text);
    color: #fff;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 999;
    pointer-events: none;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
}
.toast.success {
    background: var(--success);
}
.toast.error {
    background: var(--error);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    padding: 20px;
}
.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}
.modal {
    background: #fff;
    border-radius: 20px;
    padding: 36px 32px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}
.modal .modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    background: #f0fdf4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal h2 {
    font-size: 20px;
    color: var(--text);
    margin-bottom: 8px;
}
.modal p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 24px;
}
.modal .close-btn {
    padding: 12px 40px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.modal .close-btn:hover {
    background: var(--primary-dark);
}

/* 响应式 */
@media (max-width: 520px) {
    .login-card {
        padding: 36px 24px 30px;
        border-radius: 20px;
    }
    .login-logo img {
        width: 96px;
        height: 96px;
    }
    .login-header h1 {
        font-size: 22px;
    }
    .tab-btn {
        font-size: 14px;
        padding: 10px 14px;
    }
    .sms-btn {
        min-width: 100px;
        font-size: 13px;
        padding: 14px 10px;
    }
    .input-field input {
        font-size: 14px;
        padding: 12px 14px 12px 40px;
    }
    .submit-btn {
        font-size: 15px;
        padding: 14px;
    }
    .bg-circle:nth-child(1) {
        width: 250px;
        height: 250px;
    }
    .bg-circle:nth-child(2) {
        width: 200px;
        height: 200px;
    }
}

@media (max-width: 380px) {
    .login-card {
        padding: 28px 18px 24px;
    }
    .tab-btn {
        font-size: 13px;
        padding: 8px 10px;
    }
    .sms-btn {
        min-width: 86px;
        font-size: 12px;
    }
}
