/* 覆盖Kadence主题样式 */
.kadence-container .custom-register-form-container {
    max-width: 500px;
    margin: 3rem auto;
    /* 容器上下内边距 */
    padding: 2.5rem;
    width: 100%;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #eaeaea;
    font-size: 16px;
    /* 基础字体大小 */
}

/* 确保标签正确显示 */
.kadence-container .custom-register-form .form-group {
    display: block;
    margin-bottom: 0.6rem;
    /* 表单项间距 */
}

.kadence-container .custom-register-form label {
    display: block;
    width: 100%;
    margin-bottom: 0.2rem;
    /* 标签下间距 */
    font-size: 16px;
    /* 标签字体大小 */
    font-weight: 300;
    /* 标签加粗 */
}

/* 确保输入框宽度正确 */
.kadence-container .custom-register-form .form-control {
    width: 100%;
    max-width: 100%;
    padding-right: 40px;
    /* 为眼睛图标留空间 */
    padding: 12px 15px;
    /* 输入框内边距 */
    font-size: 16px;
    /* 输入文字大小 */
    line-height: 1.5;
    /* 行高 */
}

/* 按钮样式调整 */
.kadence-container .custom-register-form .wp-element-button {
    margin-top: 0.4rem;
    /* 按钮上间距 */
    padding: 14px 24px;
    /* 按钮内边距 */
    font-size: 16px;
    /* 按钮文字大小 */
    font-weight: 400;
    /* 按钮文字加粗 */
}

/* 隐私链接 */
.kadence-container .custom-register-form .login-link-on {
    margin-top: 1rem;
    /* 上间距 */
    margin-bottom: 0.1rem;
    font-size: 14px;
    /* 文字大小 */
}

/* 单个链接 */
.kadence-container .custom-register-form .login-link {
    margin-top: 1.5rem;
    /* 上间距 */
    font-size: 14px;
    /* 文字大小 */
}

.kadence-container .custom-register-form .description {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

@media (max-width: 768px) {
    .kadence-container .custom-register-form-container {
        padding: 1.5rem;
        margin: 2rem auto;
        /* 移动设备减少间距 */
        font-size: 14px;
        /* 移动设备字体略小 */
    }

    .kadence-container .custom-register-form label {
        font-size: 14px;
    }

    .kadence-container .custom-register-form .form-control {
        font-size: 14px;
        padding: 10px 12px;
    }
}

/* 密码输入容器 */
.kadence-container .password-input-container {
    position: relative;
    margin-bottom: 0.3rem;
    /* 密码输入框下间距 */
}

/* 眼睛图标 */
.kadence-container .show-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    height: 20px;
    width: 20px;
}

/* 成功消息样式 */
.kadence-container .registration-success {
    padding: 2rem;
    /* 增加内边距 */
    margin-bottom: 2rem;
    /* 增加下边距 */
    font-size: 16px;
    /* 文字大小 */
    line-height: 1.6;
    /* 行高 */
}

/* ===== 密码强度指示器视觉反馈 ===== */
/* 进度条基础样式 */
.kadence-container .password-strength-meter {
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
    position: relative;
    /* 确保在移动端可见 */
    z-index: 1;
}

/* 密码强度指示器的状态管理 */
:root {
    --strength-width: 0%;
    --strength-color: #f0f0f0;
}

/* 进度条动态部分 */
.kadence-container .strength-bar {
    height: 100%;
    width: 0%;
    position: absolute;
    left: 0;
    top: 0;
    transition: width 0.3s ease;
    /* 默认灰色 */
    background: #6c757d;
    /* 确保在移动端渲染 */
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* 强度文字样式 */
.kadence-container .strength-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    font-weight: bold;
    text-align: right;
    color: #6c757d;
}

/* 密码要求列表增强 */
.kadence-container .password-requirements {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
}

.kadence-container .password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
}

.kadence-container .password-requirements li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 6px;
    line-height: 0.8;
    transition: color 0.3s ease;
}

/* 验证状态图标 */
.kadence-container .password-requirements li:before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: all 0.3s ease;
}

/* 默认状态 - 圆点 */
.kadence-container .password-requirements li:before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4" fill="%23ccc"/></svg>');
}

/* 有效状态 - 绿色勾号 */
.kadence-container .password-requirements li.valid {
    color: #28a745;
}

.kadence-container .password-requirements li.valid:before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%2328a745" stroke-width="2"><path d="M20 6L9 17l-5-5"/></svg>');
    transform: translateY(-50%) scale(1.1);
}

/* 无效状态 - 红色叉号 */
.kadence-container .password-requirements li.invalid {
    color: #dc3545;
}

.kadence-container .password-requirements li.invalid:before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4" fill="%23ccc"/></svg>');
}

/* 进度条颜色状态 */
.strength-bar[style*="background-color: #28a745"] {
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.4);
}

.strength-bar[style*="background-color: #ffc107"] {
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.4);
}

.strength-bar[style*="background-color: #dc3545"] {
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    from {
        opacity: 0.8;
    }

    to {
        opacity: 1;
    }
}

/* 表单组聚焦状态 */
.kadence-container .form-group.focused {
    border-left: 3px solid #0373aa;
    padding-left: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 2px rgba(3, 115, 170, 0.2);
    border-radius: 4px;
}

@media (max-width: 768px) {
    .kadence-container .form-group.focused {
        box-shadow: 0 0 0 1px rgba(3, 115, 170, 0.2);
        border-left-width: 2px;
    }
}

/* 列表项动画 */
.kadence-container .password-requirements li.valid {
    animation: validPop 0.5s ease;
}

.kadence-container .password-requirements li.invalid {
    animation: invalidShake 0.5s ease;
}

/* 优化动画性能 */
@keyframes validPop {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

@keyframes invalidShake {

    0%,
    100% {
        transform: translateX(0) translateZ(0);
    }

    20%,
    60% {
        transform: translateX(-3px) translateZ(0);
    }

    40%,
    80% {
        transform: translateX(3px) translateZ(0);
    }
}

/* 添加GPU加速 */
.kadence-container .password-requirements li {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

@media (max-width: 768px) {
    .kadence-container .password-strength-meter {
        height: 5px;
    }

    .kadence-container .strength-bar {
        /* 移动端使用更简单的过渡 */
        transition: width 0.5s ease;
    }

    /* 确保进度条不被覆盖 */
    .password-strength-meter {
        transform: translateZ(0);
        will-change: width;
    }
}

@media (max-width: 480px) {
    .kadence-container .password-requirements ul {
        flex-direction: column;
        gap: 6px;
    }
}

/* 表单错误消息 */
.kadence-container .login-error-container {
    margin: 1.5rem 0;
    padding: 15px;
    border-radius: 8px;
    background: #fff8f8;
    border: 2px solid #ff6b6b;
    display: flex;
    align-items: center;
    animation: shake 0.5s ease;
}

/* 错误图标 */
.kadence-container .login-error-icon {
    width: 30px;
    height: 30px;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    margin-right: 15px;
    flex-shrink: 0;
}

/* 错误消息内容 */
.kadence-container .login-error-message {
    color: #d32f2f;
    font-size: 15px;
    line-height: 1.5;
}

.kadence-container .login-error-message strong {
    font-weight: 700;
    color: #b71c1c;
}

.kadence-container .login-error-message .alert-danger {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

/* 抖动动画 */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

@media (max-width: 768px) {
    .kadence-container .login-error-container {
        padding: 12px;
        margin: 1.2rem 0;
    }

    .kadence-container .login-error-icon {
        width: 25px;
        height: 25px;
        font-size: 16px;
        margin-right: 12px;
    }

    .kadence-container .login-error-message {
        font-size: 14px;
    }
}

/* 社交登录区域 */
.social-login-section {
    margin-bottom: 2rem;
}

.social-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.social-btn {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 1px solid #eaeaea;
    background: #fff;
    color: #333;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.social-btn svg {
    margin-right: 8px;
    fill: currentColor;
    width: 20px;
    height: 20px;
}

/* Google */
.social-btn.google {
    background: #fff;
    color: #757575;
    border-color: #4285F4;
}

.social-btn.google:hover {
    background: #f8f9fa;
}

.social-btn.google svg path {
    fill: #4285F4;
}

/* Facebook */
.social-btn.facebook {
    background: #1877f2;
    color: white;
    border-color: #1877f2;
}

.social-btn.facebook:hover {
    background: #166fe5;
}

.social-btn.facebook svg path {
    fill: white;
}

/* X (Twitter) */
.social-btn.x {
    background: #000;
    color: white;
    border-color: #000;
}

.social-btn.x:hover {
    background: #222;
}

.social-btn.x svg path {
    fill: white;
}

/* TikTok */
.social-btn.tiktok {
    background: #000;
    color: white;
    border-color: #000;
}

.social-btn.tiktok:hover {
    background: #333;
}

.social-btn.tiktok svg path {
    fill: white;
}

/* 分隔线 */
.divider-with-text {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: #eaeaea;
}

.divider-text {
    padding: 0 12px;
    color: #777;
    font-size: 14px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .social-buttons {
        gap: 8px;
    }

    .social-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .social-btn svg {
        margin-right: 6px;
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .social-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .social-btn {
        width: 100%;
        justify-content: center;
    }
}

.custom-success {
    padding: 1rem;
    background: #f0fff4;
    border-radius: 8px;
    border: 1px solid #c6f6d5;
}

.custom-success .success-icon {
    text-align: center;
    font-size: 3rem;
    color: #48bb78;
    margin-bottom: 1rem;
}

.custom-success .error-icon {
    text-align: center;
    font-size: 3rem;
    color: #dc3545;
    margin-bottom: 1rem;
}

.custom-success h3 {
    text-align: center;
    color: #2f855a;
    margin-bottom: 1rem;
}

.custom-success .email-note {
    font-size: 0.875rem;
    color: #718096;
    margin-top: 1rem;
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 5px;
    display: none;
}

/* 两个链接水平排列 */
.login-links {
    display: flex;
    justify-content: space-between;
    /* 两端对齐 */
    align-items: center;
    /* 垂直居中 */
    margin-top: 20px;
    /* 上方间距 */
    width: 100%;
    font-size: 14px;
    flex-wrap: wrap;
    /* 小屏幕允许换行 */
}

@media (max-width: 768px) {
    .login-links {
        flex-direction: column;
        /* 小屏幕垂直排列 */
        gap: 10px;
    }
}
