/* ==============================
   全局重置与基础布局
   ============================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body,
html {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f8f8f8;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    margin: 0 auto;
}

h1 {
    margin: 0.2rem;
    font-size: 1.2rem;
}

p {
    font-size: 1rem;
    line-height: 1.5rem;
    font-weight: 100;
    margin: 1.2rem 0;
    letter-spacing: 0.1rem;
}

a {
    color: #333;
    font-size: 1rem;
    text-decoration: none;
}

.container {
    position: relative;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
    padding: 0.6rem;
    width: 35rem;
    overflow: hidden;
    max-width: 100vw;
    min-height: 70vh;
}

.form-container form {
    background: #fff;
    display: flex;
    flex-direction: column;
    padding: 0 1.8rem;
    height: 100%;
    justify-content: center;
    align-items: center;
}

.form-container input {
    width: 100%;
    height: 2.2rem;
    text-indent: 1rem;
    border: 1px solid #ccc;
    border-left: none;
    border-right: none;
    border-top: none;
    outline: none;
    margin: 0.6rem 0;
}

.form-container button:active {
    transform: scale(0.95, 0.95);
}

.form-container button {
    padding: 0.4rem 1rem;
    background: #417dff;
    color: white;
    border: 1px solid #fff;
    outline: none;
    cursor: pointer;
    width: 5rem;
    border-radius: 8px;
    transition: all 100ms ease-in;
    margin: 0.6rem 0;
    font-size: 0.6rem;
    padding: 0.5rem 0;
}

button.ghost {
    background: transparent;
    border-color: #fff;
    border: 1px solid #fff;
    outline: none;
    cursor: pointer;
    width: 5rem;
    border-radius: 8px;
    transition: all 800ms ease-in;
    margin: 0.6rem 0;
    padding: 0.5rem 0;
    color: white;
    font-size: 0.6rem;
}

button.ghost:active {
    transform: scale(0.95, 0.95);
}

.form-container {
    position: absolute;
    top: 0;
    height: 100%;
    transition: all 0.5s ease-in;
}

.sing-in-container {
    left: 0;
    width: 50%;
    z-index: 2;
}

.sign-up-container {
    left: 0;
    width: 50%;
    opacity: 0;
    z-index: 1;
}

.overlay {
    background: #417dff;
    width: 200%;
    height: 100%;
    position: relative;
    left: -100%;
    transition: all 0.6s ease-in-out;
    color: white;
}

.overlay-container {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
    transition: all 0.6s ease-in-out;
    z-index: 99;
}

.overlay-pannel {
    position: absolute;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 50%;
    height: 100%;
    padding: 0 2.2rem;
}

.overlay-right {
    right: 0;
}

.container.right-pannrl-active .overlay-container {
    transform: translateX(-100%);
}

.container.right-pannrl-active .sing-in-container {
    transform: translateX(100%);
}

.container.right-pannrl-active .sign-up-container {
    transform: translateX(100%);
    opacity: 1;
    z-index: 5;
    transition: all 0.6s ease-in-out;
}

.container.right-pannrl-active .overlay {
    transform: translateX(50%);
}

.container.right-pannrl-active .overlay-left {
    transform: translateX(0);
    transition: all 0.6s ease-in-out;
}

.container.right-pannrl-active .overlay-right {
    transform: translateX(20%);
    transition: all 0.6s ease-in-out;
}

/* ==============================
   密码强度指示器
   ============================== */
.strength-meter {
    width: 100%;
    margin-top: -2px;
    margin-bottom: 4px;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.strength-meter.visible {
    opacity: 1;
    transform: translateY(0);
}

.strength-bar {
    width: 100%;
    height: 4px;
    background: #e8e8e8;
    border-radius: 3px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: width 0.3s ease, background-color 0.3s ease;
    background-color: transparent;
}

.strength-fill.weak {
    background-color: #ff4757;
    width: 25%;
}

.strength-fill.medium {
    background-color: #ffa502;
    width: 50%;
}

.strength-fill.strong {
    background-color: #417dff;
    width: 75%;
}

.strength-fill.very-strong {
    background-color: #2ed573;
    width: 100%;
}

.strength-label {
    font-size: 0.68rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    color: #999;
    min-height: 18px;
    transition: color 0.3s ease;
}

.strength-label .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    background-color: transparent;
}

.strength-label.weak { color: #ff4757; }
.strength-label.weak .dot { background-color: #ff4757; }
.strength-label.medium { color: #ffa502; }
.strength-label.medium .dot { background-color: #ffa502; }
.strength-label.strong { color: #417dff; }
.strength-label.strong .dot { background-color: #417dff; }
.strength-label.very-strong { color: #2ed573; }
.strength-label.very-strong .dot { background-color: #2ed573; }

/* 密码匹配提示 */
.match-hint {
    width: 100%;
    font-size: 0.68rem;
    margin-top: -4px;
    margin-bottom: 2px;
    text-align: right;
    min-height: 18px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.match-hint.visible { opacity: 1; }
.match-hint.match-success { color: #2ed573; }
.match-hint.match-error { color: #ff4757; }

/* ==============================
   Flash 弹窗
   ============================== */
.flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.flash-overlay.show { opacity: 1; visibility: visible; }

.flash-modal {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    padding: 24px;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.flash-overlay.show .flash-modal { transform: translateY(0); }

.flash-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 0;
}

.flash-close:hover { opacity: 1; }

.flash-close::before,
.flash-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 2px;
    background-color: #666;
}

.flash-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.flash-close::after { transform: translate(-50%, -50%) rotate(-45deg); }

.flash-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 16px;
    font-size: 24px;
    font-weight: bold;
}

.flash-content { text-align: center; }
.flash-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; color: #333; }
.flash-message { font-size: 14px; color: #666; line-height: 1.5; }

.flash-success .flash-icon { background-color: #d4edda; color: #155724; }
.flash-success .flash-title { color: #155724; }
.flash-error .flash-icon { background-color: #f8d7da; color: #721c24; }
.flash-error .flash-title { color: #721c24; }
.flash-warning .flash-icon { background-color: #fff3cd; color: #856404; }
.flash-warning .flash-title { color: #856404; }
.flash-info .flash-icon { background-color: #d1ecf1; color: #0c5460; }
.flash-info .flash-title { color: #0c5460; }

/* ==============================
   两步注册流程
   ============================== */
.step-container {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
.step-container.active {
    display: flex;
}

/* 步骤按钮行 */
.step-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 0.8rem 0 0.5rem;
    width: 100%;
}

.next-btn, .prev-btn, .submit-btn {
    padding: 0.4rem 1rem;
    background: #417dff;
    color: white;
    border: 1px solid #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.6rem;
    width: auto;
    min-width: 5rem;
    transition: all 0.2s;
}
.next-btn:hover, .prev-btn:hover {
    background: #2a5fd4;
}
.submit-btn {
    background: #2ed573;
    font-weight: bold;
}
.submit-btn:hover {
    background: #26b55a;
}

/* 图形验证码区域（图片在上，输入框在下） */
.captcha-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.2rem;
}
.captcha-img {
    width: 130px;
    height: 44px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 4px;
}
.captcha-tip {
    width: 100%;
    font-size: 0.55rem;
    color: #999;
    text-align: right;
    margin-top: -8px;
    margin-bottom: 8px;
    min-height: 16px;
}

/* 邮箱验证码行 */
.email-code-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0.6rem 0;
}
.email-code-row input {
    flex: 1;
    margin: 0;
    height: 2.2rem;
}

/* 发送验证码按钮 */
.send-code-btn {
    white-space: nowrap;
    padding: 0 6px;
    height: 2.2rem;
    font-size: 0.6rem;
    background: #417dff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}
.send-code-btn:hover {
    background: #2a5fd4;
}
.send-code-btn:disabled {
    background: #a0a0a0;
    cursor: not-allowed;
}