/**
 * HiTemp 找回密码页面样式
 */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;600;700&display=swap');

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

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: #f0f2f5;
    background-image: 
        radial-gradient(at 40% 20%, rgba(255,255,255,0.8) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(240,242,245,0.6) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(255,255,255,0.5) 0px, transparent 50%),
        radial-gradient(at 80% 80%, rgba(245,247,250,0.6) 0px, transparent 50%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
}

/* 主容器 */
.login-container {
    display: flex;
    max-width: 920px;
    width: 100%;
    min-height: 560px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08), 0 2px 10px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    position: relative;
}

/* 左侧品牌区域 */
.login-brand {
    width: 45%;
    background: linear-gradient(160deg, #1a2a3a 0%, #263238 50%, #37474f 100%);
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* 背景装饰 */
.login-brand::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(255,255,255,0.08) 0%, transparent 40%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(2%, 2%) rotate(1deg); }
    50% { transform: translate(0, 4%) rotate(0deg); }
    75% { transform: translate(-2%, 2%) rotate(-1deg); }
}

/* 科技感圆环装饰 */
.brand-decoration {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.brand-decoration .circle {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.brand-decoration .circle-1 {
    width: 300px;
    height: 300px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-color: rgba(255, 255, 255, 0.15);
}

.brand-decoration .circle-2 {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-color: rgba(255, 255, 255, 0.2);
}

.brand-decoration .circle-3 {
    width: 400px;
    height: 400px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-color: rgba(255, 255, 255, 0.08);
}

.brand-decoration .dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
}

.brand-decoration .dot-1 { top: 20%; left: 20%; }
.brand-decoration .dot-2 { top: 30%; right: 25%; width: 6px; height: 6px; }
.brand-decoration .dot-3 { bottom: 25%; left: 30%; width: 10px; height: 10px; }
.brand-decoration .dot-4 { bottom: 20%; right: 20%; width: 5px; height: 5px; }

/* Logo */
.brand-logo {
    position: relative;
    z-index: 2;
    margin-bottom: 30px;
}

.brand-logo img {
    max-width: 200px;
    max-height: 60px;
    height: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.brand-logo .site-name {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* 品牌描述 */
.brand-description {
    position: relative;
    z-index: 2;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    line-height: 1.8;
    max-width: 240px;
}

/* 右侧表单区域 */
.login-form-wrapper {
    width: 55%;
    padding: 50px 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 关闭按钮 */
.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    width: 32px;
    height: 32px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    text-decoration: none;
}

.close-btn:hover {
    background: #ff5722;
    border-color: #ff5722;
    transform: scale(1.05);
}

.close-btn svg {
    width: 16px;
    height: 16px;
    color: #9ca3af;
}

.close-btn:hover svg {
    color: #fff;
}

/* 表单标题 */
.form-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
    text-align: center;
}

.form-subtitle {
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 35px;
    text-align: center;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    margin-bottom: 8px;
}

/* 输入框 */
.form-input {
    width: 100%;
    height: 52px;
    padding: 0 20px 0 50px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    color: #1a1a2e;
    background: #f9fafb;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: #ff5722;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 87, 34, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

/* 输入框图标 */
.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #9ca3af;
    pointer-events: none;
}

/* 提交按钮 */
.submit-btn {
    width: 100%;
    height: 54px;
    background: linear-gradient(135deg, #ff5722 0%, #ff7043 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 87, 34, 0.3);
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #e64a19 0%, #ff5722 100%);
    box-shadow: 0 6px 20px rgba(255, 87, 34, 0.4);
    transform: translateY(-2px);
}

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

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* 加载状态 */
.submit-btn.loading {
    pointer-events: none;
}

.submit-btn .btn-text {
    transition: opacity 0.3s ease;
}

.submit-btn.loading .btn-text {
    opacity: 0;
}

.submit-btn .btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: spin 0.8s linear infinite;
}

.submit-btn.loading .btn-loader {
    opacity: 1;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 底部链接 */
.form-footer {
    text-align: center;
    font-size: 14px;
    color: #6b7280;
}

.form-footer a {
    color: #ff5722;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.form-footer a:hover {
    color: #e64a19;
}

/* 验证码 */
.captcha-group {
    display: flex;
    gap: 12px;
    align-items: center;
    position: relative;
}

.captcha-group .form-input {
    flex: 1;
    padding-left: 50px;
}

.captcha-group > .input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.captcha-box {
    width: 120px;
    height: 52px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.captcha-box:hover {
    border-color: #ff5722;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
}

.captcha-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 45%, rgba(0,0,0,0.03) 45%, rgba(0,0,0,0.03) 55%, transparent 55%),
        linear-gradient(-45deg, transparent 45%, rgba(0,0,0,0.03) 45%, rgba(0,0,0,0.03) 55%, transparent 55%);
    background-size: 8px 8px;
    pointer-events: none;
}

.captcha-code {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 8px;
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #ff5722 0%, #ff7043 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    position: relative;
    z-index: 1;
}

.captcha-box .captcha-noise {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.captcha-box .captcha-noise::before,
.captcha-box .captcha-noise::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    background: rgba(0,0,0,0.1);
}

.captcha-box .captcha-noise::before {
    top: 35%;
    transform: rotate(-5deg);
}

.captcha-box .captcha-noise::after {
    bottom: 35%;
    transform: rotate(3deg);
}

/* 弹窗消息提示 */
.toast-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    pointer-events: none;
}

.toast-message {
    padding: 16px 28px;
    border-radius: 12px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    pointer-events: auto;
    max-width: 90%;
}

.toast-message.hiding {
    animation: toastOut 0.3s ease forwards;
}

.toast-message.error {
    background: #fff;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.toast-message.success {
    background: #fff;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

.toast-message svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.toast-message span {
    font-weight: 500;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* 响应式设计 */
@media screen and (max-width: 900px) {
    .login-container {
        max-width: 450px;
        flex-direction: column;
        min-height: auto;
    }
    
    .login-brand {
        width: 100%;
        padding: 40px 30px;
        min-height: 220px;
    }
    
    .brand-decoration .circle-1 { width: 200px; height: 200px; }
    .brand-decoration .circle-2 { width: 140px; height: 140px; }
    .brand-decoration .circle-3 { width: 260px; height: 260px; }
    
    .brand-logo .site-name {
        font-size: 24px;
    }
    
    .brand-description {
        font-size: 13px;
        max-width: 280px;
    }
    
    .login-form-wrapper {
        width: 100%;
        padding: 35px 30px 40px;
    }
    
    .form-title {
        font-size: 24px;
    }
    
    .close-btn {
        top: 15px;
        right: 15px;
    }
}

@media screen and (max-width: 480px) {
    html {
        overscroll-behavior: none;
    }

    body {
        padding: 12px;
        background: #fff;
        background-image: none;
        min-height: 0;
        overscroll-behavior: none;
        flex-direction: column;
    }
    
    .login-container {
        min-height: calc(100vh - 24px);
        min-height: calc(100dvh - 24px);
        max-width: none;
        border-radius: 16px;
        box-shadow: none;
        margin: auto;
    }
    
    .login-brand {
        padding: 30px 20px;
        min-height: 180px;
    }
    
    .brand-logo .site-name {
        font-size: 20px;
    }
    
    .brand-description {
        font-size: 12px;
    }
    
    .login-form-wrapper {
        padding: 25px 20px 30px;
    }
    
    .form-title {
        font-size: 22px;
    }
    
    .form-input {
        height: 48px;
        font-size: 16px; /* 避免 iOS 聚焦时自动放大页面 */
    }
    
    .submit-btn {
        height: 50px;
        font-size: 15px;
    }
}

