/* ===== 全局重置 —— 苹果极简基调 ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-font-smoothing: antialiased;
    height: 100%;
    background: #fbfbfd;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #fbfbfd;
    color: #1d1d1f;
    line-height: 1.5;
    letter-spacing: -0.01em;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

:root {
    --brand-blue: #0071e3;
    --brand-blue-dark: #005bb5;
    --brand-error: #de071c;
    --card-bg: rgba(255, 255, 255, 0.85);
}

/* ===== 底部波浪 ===== */
.wave-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 15vh;
    min-height: 100px;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(245, 247, 250, 0.7) 100%);
}

.waves {
    position: relative;
    width: 100%;
    height: 100%;
    margin-bottom: -7px;
}

.parallax > use {
    animation: move-forever 30s cubic-bezier(.55, .5, .45, .5) infinite;
}

.parallax > use:nth-child(1) {
    animation-delay: -2s;
    animation-duration: 18s;
}

.parallax > use:nth-child(2) {
    animation-delay: -3s;
    animation-duration: 24s;
}

.parallax > use:nth-child(3) {
    animation-delay: -4s;
    animation-duration: 32s;
}

.parallax > use:nth-child(4) {
    animation-delay: -5s;
    animation-duration: 45s;
}

@keyframes move-forever {
    0% {
        transform: translate3d(-90px, 0, 0);
    }
    100% {
        transform: translate3d(85px, 0, 0);
    }
}

/* ===== 主体 ===== */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 10;
    padding: 40px 0;
}

.login-card {
    width: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 28px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.03), 0 1px 4px rgba(0, 0, 0, 0.02), inset 0 0 0 0.5px rgba(255, 255, 255, 0.8);
    padding: 40px 36px;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

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

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-header h1 {
    font-size: 26px;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.login-header p {
    font-size: 14px;
    color: #86868b;
}

/* =======================================================
   纯手写表单样式 (摒弃 Layui 默认布局)
   ======================================================= */
.layui-form-item {
    margin-bottom: 18px !important;
    position: relative;
}

.form-input-container {
    position: relative;
    width: 100%;
}

/* 左侧前缀图标 */
.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #a1a1a6;
    z-index: 2;
    transition: color 0.25s ease;
    pointer-events: none;
}

/* 输入框本体 */
.layui-input {
    width: 100%;
    height: 52px !important;
    line-height: 52px !important;
    background-color: #f5f5f7 !important;
    border: 1px solid transparent !important;
    border-radius: 14px !important;
    padding-left: 44px !important;
    padding-right: 48px !important;
    font-size: 15px;
    transition: all 0.25s ease !important;
    color: #1d1d1f !important;
}

/* 聚焦状态 */
.layui-input:focus {
    background-color: #ffffff !important;
    border-color: var(--brand-blue) !important;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12) !important;
}

.form-input-container:focus-within .input-icon {
    color: var(--brand-blue);
}

/* 右侧手写眼睛图标 */
.password-eye {
    position: absolute;
    right: 16px;
    top: 0;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #a1a1a6;
    cursor: pointer;
    z-index: 2;
    transition: color 0.2s ease;
}

.password-eye:hover, .form-input-container:focus-within .password-eye {
    color: var(--brand-blue);
}

/* ===== 错误提示与状态 ===== */
.has-error .layui-input {
    border-color: var(--brand-error) !important;
    background-color: #fff5f5 !important;
}

.has-error .layui-input:focus {
    box-shadow: 0 0 0 4px rgba(222, 7, 28, 0.1) !important;
}

.has-error .input-icon, .has-error .password-eye {
    color: var(--brand-error) !important;
}

.error-msg {
    display: block;
    font-size: 12px;
    color: var(--brand-error);
    margin-top: 6px;
    padding-left: 16px;
    animation: shake 0.3s ease-in-out;
    font-weight: 500;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-4px);
    }
    75% {
        transform: translateX(4px);
    }
}

/* ===== 协议勾选 ===== */
.agreement-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 24px 0;
    font-size: 13px;
    color: #86868b;
}

.agreement-wrap .layui-form-checkbox[lay-skin="primary"] {
    padding-left: 26px;
    color: #86868b;
}

.agreement-wrap .layui-form-checkbox[lay-skin="primary"] i {
    border-radius: 4px;
    border-color: #d2d2d7;
    transition: all 0.2s;
}

.agreement-wrap .layui-form-checkbox[lay-skin="primary"]:hover i {
    border-color: var(--brand-blue);
}

.agreement-wrap .layui-form-checkbox[lay-skin="primary"].layui-form-checked i {
    background-color: var(--brand-blue) !important;
    border-color: var(--brand-blue) !important;
}

.agreement-wrap a {
    color: var(--brand-blue);
    font-weight: 500;
}

.agreement-wrap a:hover {
    color: var(--brand-blue-dark);
    text-decoration: underline;
}

.agreement-error {
    font-size: 12px;
    color: var(--brand-error);
    margin-top: -16px;
    margin-bottom: 16px;
    font-weight: 500;
    padding-left: 16px;
}

/* ===== 提交按钮 ===== */
.btn-submit {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 14px;
    background: var(--brand-blue);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-submit:hover {
    background: var(--brand-blue-dark);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(0, 113, 227, 0.3);
}

.btn-submit:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.15);
}

/* 底部 */
.login-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 13px;
    color: #86868b;
}

.login-footer a {
    color: var(--brand-blue);
    font-weight: 500;
}

.page-footer {
    position: absolute;
    bottom: 16px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: #86868b;
    z-index: 10;
}

/* ===== 移动端 ===== */
@media (max-width: 768px) {
    .login-container {
        padding-left: 0;
        padding-right: 0;
    }

    .login-container .layui-row {
        margin-left: 0;
        margin-right: 0;
    }

    .login-container [class*="layui-col-xs"] {
        padding-left: 0;
        padding-right: 0;
    }

    .main-wrapper {
        padding: 20px 16px;
    }

    .login-card {
        padding: 32px 20px;
        border-radius: 22px;
    }
}
