/* ============================================
   EDI商城 登录注册页面 - 现代玻璃拟态设计
   ============================================ */

/* CSS变量 */
:root {
    --primary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --secondary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.25);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --accent-color: #f5576c;
    --error-color: #f5576c;
    --success-color: #4ecdc4;
    --card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    background: #1a1a2e;
}

/* 动态背景 */
.bg-animated {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(135deg, #0a0a18 0%, #121228 50%, #1a1a35 100%);
}

/* 背景装饰层 */
.bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 10% 20%, rgba(0, 180, 255, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 20%, rgba(255, 100, 100, 0.12) 0%, transparent 35%),
        radial-gradient(circle at 15% 80%, rgba(100, 150, 255, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 85% 75%, rgba(255, 180, 50, 0.1) 0%, transparent 35%);
}

/* 工业网格 */
.bg-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 180, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 180, 255, 0.06) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* 浮动装饰 - 不使用，隐藏 */
.bg-shapes {
    display: none;
}

/* 主容器 */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    padding-top: 5vh;
    position: relative;
    z-index: 1;
}

/* 品牌区域 */
.brand-section {
    text-align: center;
    margin-bottom: 28px;
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.brand-logo {
    width: 90px;
    height: 90px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 8px 32px rgba(240, 147, 251, 0.2),
        inset 0 0 0 1px rgba(255,255,255,0.1);
    animation: logoFloat 3s ease-in-out infinite;
    position: relative;
}

.brand-logo::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 50%, #8b5cf6 100%);
    z-index: -1;
    animation: logoBorder 4s linear infinite;
}

.brand-logo::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a1a3e 0%, #24243e 100%);
    z-index: -1;
    animation: logoBorder 4s linear infinite reverse;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

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

.logo-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.brand-title {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 50%, #c7d2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: none;
    letter-spacing: 2px;
}

.brand-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

/* 登录卡片 - 3D翻转效果 */
.auth-card {
    width: 100%;
    max-width: 420px;
    perspective: 1000px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

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

.card-face {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    padding: 40px;
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
    backface-visibility: hidden;
    position: relative;
    overflow: hidden;
}

.card-face::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
}

/* 卡片正面 */
.card-front {
    position: relative;
    z-index: 2;
}

/* 卡片背面 */
.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transform: rotateY(180deg);
    z-index: 1;
}

/* 翻转状态 */
.auth-card.flipped .card-front {
    transform: rotateY(-180deg);
}

.auth-card.flipped .card-back {
    transform: rotateY(0deg);
    z-index: 2;
}

/* 卡片头部 */
.card-header {
    text-align: center;
    margin-bottom: 32px;
}

.card-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.card-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* 表单 */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 输入框组 */
.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.5);
    transition: var(--transition-smooth);
    z-index: 1;
}

.input-icon svg {
    width: 100%;
    height: 100%;
}

.input-group input {
    width: 100%;
    padding: 16px 48px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid transparent;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition-smooth);
    outline: none;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.input-group input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-color);
}

.input-group.focused .input-icon {
    color: var(--accent-color);
}

/* 输入框下划线动画 */
.input-line {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 1px;
}

.input-group input:focus ~ .input-line {
    width: calc(100% - 32px);
}

/* 密码显示切换 */
.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: rgba(255, 255, 255, 0.5);
    transition: var(--transition-smooth);
}

.password-toggle:hover {
    color: var(--accent-color);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

/* 表单选项 */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

/* 自定义复选框 */
.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
}

.checkbox-wrapper input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.checkbox-wrapper input:checked + .checkmark {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.checkbox-wrapper input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.forgot-link:hover {
    color: var(--accent-color);
}

/* 协议 */
.agreement {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.agreement a {
    color: var(--accent-color);
    text-decoration: none;
}

.agreement a:hover {
    text-decoration: underline;
}

/* 主按钮 */
.btn-primary {
    position: relative;
    width: 100%;
    padding: 16px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition-smooth);
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(240, 147, 251, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* 按钮波纹效果 */
.btn-ripple {
    position: absolute;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transform: scale(0);
    pointer-events: none;
}

.btn-ripple.active {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    to { transform: scale(20); opacity: 0; }
}

/* 卡片底部 */
.card-footer {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.card-footer a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.card-footer a:hover {
    text-decoration: underline;
}

/* 返回首页 */
.back-home {
    position: fixed;
    top: 30px;
    left: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 10px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    transition: var(--transition-smooth);
    animation: fadeInDown 0.8s ease-out 0.4s both;
}

.back-home:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-5px);
}

.back-home svg {
    width: 18px;
    height: 18px;
}

/* 消息提示 */
.msg-wrap {
    margin-bottom: 16px;
}

.msg-error {
    background: rgba(245, 87, 108, 0.2);
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* 响应式 */
@media (max-width: 480px) {
    .brand-title { font-size: 1.5rem; }
    .brand-subtitle { font-size: 0.85rem; }
    .card-face { padding: 30px 24px; }
    .card-header h2 { font-size: 1.5rem; }
    .input-group input { padding: 14px 44px; }
    .back-home {
        top: 15px;
        left: 15px;
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

/* 加载动画 */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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