/* ========================================
   雅加达生活通 - 会员注册页样式
   ======================================== */

/* ---------- 背景装饰 ---------- */
.bg-decoration {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-decoration::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(255, 85, 46, 0.08) 0%, transparent 70%);
    animation: floatBlob 20s ease-in-out infinite;
}

.bg-decoration::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(245, 166, 35, 0.1) 0%, transparent 70%);
    animation: floatBlob 25s ease-in-out infinite reverse;
}

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

/* ---------- 装饰图案 ---------- */
.pattern-overlay {
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23E85D2D' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

/* ---------- 主容器 ---------- */
.container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    max-width: 480px;
    margin: 0 auto;
}

/* ---------- 头部返回 ---------- */
.header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    animation: fadeInDown 0.6s ease-out;
}

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

.back-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: var(--shadow);
}

.back-btn:hover {
    transform: translateX(-2px);
    box-shadow: var(--shadow-hover);
}

.back-btn svg {
    width: 20px;
    height: 20px;
    fill: var(--text-secondary);
    transition: fill 0.2s;
}

.back-btn:hover svg {
    fill: var(--primary);
}

.header-title {
    flex: 1;
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 40px;
}

/* ---------- 品牌区域 ---------- */
.brand-section {
    text-align: center;
    margin-bottom: 26px;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

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

.brand-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(255, 85, 46, 0.3);
    position: relative;
    overflow: hidden;
}

.brand-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.2) 50%, transparent 70%);
    animation: brandShine 3s ease-in-out infinite;
}

@keyframes brandShine {
    0%, 100% { transform: translateX(-100%) rotate(45deg); }
    50% { transform: translateX(100%) rotate(45deg); }
}

.brand-icon svg {
    width: 32px;
    height: 32px;
    fill: white;
    position: relative;
    z-index: 1;
}

.brand-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.brand-subtitle {
    font-size: 0.84rem;
    color: var(--text-muted);
}

/* ---------- 步骤指示器 ---------- */
.steps-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 32px;
    animation: fadeInUp 0.6s ease-out 0.15s both;
    padding: 0 20px;
}

/* 背景横线 - 穿过数字中心 */
.steps-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 40px;
    right: 40px;
    height: 2px;
    background: var(--border);
    transform: translateY(-50%);
    z-index: 0;
}

.step-item {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.step-item:not(:last-child) {
    margin-right: 48px;
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.step-item.active .step-number {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 85, 46, 0.3);
}

.step-item:not(.active) .step-number {
    background: var(--bg-card);
    color: var(--text-muted);
    border: 2px solid var(--border);
}

.step-item.completed .step-number {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
    color: white;
    border: none;
}

/* 已完成步骤前面的线段变绿 */
.step-item.completed ~ .step-item .step-number::before,
.step-item.active .step-number::before {
    content: '';
    position: absolute;
    left: -48px;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 2px;
    background: linear-gradient(90deg, var(--success) 0%, var(--primary) 100%);
    z-index: -1;
}

.step-item.completed:not(:first-child) .step-number::before {
    background: linear-gradient(90deg, var(--success-light) 0%, var(--success) 100%);
}

.step-item.active:not(:first-child) .step-number::before {
    background: linear-gradient(90deg, var(--success) 0%, var(--primary) 100%);
}

.step-item:first-child .step-number::before {
    display: none;
}

/* ---------- 表单卡片 ---------- */
.form-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    animation: fadeInUp 0.6s ease-out 0.2s both;
    position: relative;
    overflow: hidden;
}

.form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 50%, var(--primary-light) 100%);
}

.form-section-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 2px;
}

/* ---------- 表单组 ---------- */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-label .required {
    color: var(--primary);
    margin-left: 2px;
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    padding-left: 44px;
    font-size: 0.95rem;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all 0.25s ease;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(255, 85, 46, 0.1);
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    fill: var(--text-muted);
    transition: fill 0.2s;
}

.form-input:focus + .input-icon,
.input-wrapper:has(.form-input:focus) .input-icon {
    fill: var(--primary);
}

/* ---------- 密码可见性切换 ---------- */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
}

.password-toggle:hover {
    background: rgba(0,0,0,0.04);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    fill: var(--text-muted);
    transition: fill 0.2s;
}

.password-toggle:hover svg {
    fill: var(--primary);
}

/* ---------- 密码强度指示器 ---------- */
.password-strength {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.strength-bar.weak {
    background: #FF4757;
}

.strength-bar.medium {
    background: var(--accent);
}

.strength-bar.strong {
    background: var(--success);
}

.strength-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.strength-text.weak { color: #FF4757; }
.strength-text.medium { color: var(--accent); }
.strength-text.strong { color: var(--success); }

/* ---------- 手机号输入组 ---------- */
.phone-input-group {
    display: flex;
    gap: 10px;
}

.country-code {
    width: 90px;
    padding: 14px 12px;
    font-size: 0.95rem;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}

.country-code:focus {
    border-color: var(--primary);
}

.phone-input-group .form-input {
    flex: 1;
}

/* ---------- 验证码输入 ---------- */
.code-input-wrapper {
    display: flex;
    gap: 10px;
}

.code-input-wrapper .form-input {
    flex: 1;
}

.send-code-btn {
    flex-shrink: 0;
    padding: 0 20px;
    height: 48px;
    background: linear-gradient(135deg, var(--bg) 0%, #f5f5f5 100%);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-body);
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.send-code-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 85, 46, 0.3);
}

.send-code-btn:disabled {
    color: var(--text-muted);
    border-color: var(--border);
    cursor: not-allowed;
}

/* ---------- 协议勾选 ---------- */
.agreement-group {
    margin: 24px 0;
}

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.checkbox-custom {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-top: 2px;
}

.checkbox-custom svg {
    width: 14px;
    height: 14px;
    fill: white;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.checkbox-wrapper input {
    display: none;
}

.checkbox-wrapper input:checked + .checkbox-custom {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-color: var(--primary);
}

.checkbox-wrapper input:checked + .checkbox-custom svg {
    opacity: 1;
    transform: scale(1);
}

.agreement-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.agreement-text a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

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

/* ---------- 提交按钮 ---------- */
.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-body);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(255, 85, 46, 0.3);
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.2) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.submit-btn:hover::before {
    transform: translateX(100%);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 85, 46, 0.4);
}

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

.submit-btn:disabled {
    background: var(--border);
    box-shadow: none;
    cursor: not-allowed;
}

/* ---------- 分隔线 ---------- */
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 28px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ---------- 社交登录 ---------- */
.social-login {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.social-btn {
    width: 52px;
    height: 52px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.social-btn svg {
    width: 26px;
    height: 26px;
}

/* ---------- 底部链接 ---------- */
.footer-link {
    text-align: center;
    margin-top: 24px;
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

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

.footer-link-text a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
}

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

/* ---------- 响应式 ---------- */
@media (min-width: 768px) {
    .container {
        padding: 40px 24px;
        justify-content: center;
    }

    .form-card {
        padding: 36px 32px;
    }
}

/* ---------- 深色模式 ---------- */
@media (prefers-color-scheme: dark) {
    .bg-decoration::before {
        background: radial-gradient(circle, rgba(255, 85, 46, 0.15) 0%, transparent 70%);
    }

    .bg-decoration::after {
        background: radial-gradient(circle, rgba(245, 166, 35, 0.12) 0%, transparent 70%);
    }

    .form-input {
        background: rgba(255,255,255,0.05);
    }

    .form-input:focus {
        background: rgba(255,255,255,0.08);
    }

    .country-code {
        background: rgba(255,255,255,0.05);
    }

    .send-code-btn {
        background: rgba(255,255,255,0.05);
    }

    .checkbox-custom {
        background: rgba(255,255,255,0.05);
    }

    .social-btn {
        background: rgba(255,255,255,0.05);
    }
}
