/* 登录页样式（仅手机端，页面最大宽度 768px） */

html,
body {
    margin: 0;
    padding: 0;
}

.login {
    max-width: 768px;
    min-height: 100vh;
    margin: 0 auto;
    /* 备案号实际占位高度：上下内边距 + 文字行高 */
    --beian-height: 39px;
    position: relative;
    /* 整页背景图：已包含顶部装饰、底部装饰、头部插画 */
    background-color: #f4e9f4;
    background-image: url('../imgs/recharge-bg.jpg');
    background-repeat: no-repeat;
    background-position: center top;
    background-size: 100% 100%;
    overflow: hidden;
}

/* 支持安全区的浏览器：把底部安全区叠加进备案号占位高度 */
@supports (padding: env(safe-area-inset-bottom)) {
    .login {
        --beian-height: calc(39px + env(safe-area-inset-bottom));
    }
}

/* 内容层 */
.login__inner {
    position: relative;
    z-index: 1;
    padding: 0 24px;
    /* 预留备案号高度，避免内容被压住 */
    padding-bottom: 51px; /* fallback for older browsers without CSS var support */
    padding-bottom: calc(var(--beian-height) + 12px);
}

/* 头部插画占位：插画来自背景图，此处仅撑出对应高度 */
.login__hero {
    height: 34vh;
    min-height: 260px;
}

/* 标题 */
.login__title {
    margin: 18px 0 0;
    font-family: 'PingFang SC', sans-serif;
    font-size: 22px;
    font-weight: 800;
    font-style: normal;
    color: #433A58;
    text-align: center;
    text-transform: none;
    letter-spacing: 1px;
}

.login__subtitle {
    margin: 10px 0 0;
    font-family: 'PingFang SC', sans-serif;
    font-size: 16px;
    font-weight: 400;
    font-style: normal;
    color: #433A58;
    text-align: center;
    text-transform: none;
}

/* 表单 */
.login__form {
    margin-top: 34px;
}

.login__field {
    margin-bottom: 22px;
}

.login__label {
    display: block;
    margin-bottom: 10px;
    font-family: 'PingFang SC', sans-serif;
    font-size: 16px;
    font-weight: 500;
    font-style: normal;
    color: #5E5377;
    line-height: 24px;
    text-align: left;
    text-transform: none;
}

/* 输入框外壳 */
.login__input-wrap {
    display: flex;
    align-items: center;
    height: 52px;
    padding: 0 16px;
    background: #fff;
    border: 1px solid #ece3ef;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(160, 120, 190, 0.06);
}

.login__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    color: #b9a6d4;
}

.login__icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.login__input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 15px;
    color: #3d3450;
}

.login__input::-webkit-input-placeholder {
    color: #b3aabd;
}
.login__input::placeholder {
    color: #b3aabd;
}

/* 发送验证码 */
.login__send-code {
    flex-shrink: 0;
    padding: 0;
    padding-left: 12px;
    border: 0;
    background: transparent;
    font-size: 14px;
    color: #B085F4;
    white-space: nowrap;
    cursor: pointer;
    height: 45px;
}

.login__send-code--disabled {
    color: #c3b5d2;
    cursor: not-allowed;
}

/* 登录按钮 */
.login__submit {
    display: block;
    width: 100%;
    height: 50px;
    margin-top: 34px;
    border: 0;
    border-radius: 25px;
    background: linear-gradient(142deg, #EDDBF6 0%, #B085F4 100%);
    box-shadow: 0 6px 16px rgba(167, 143, 216, 0.35);
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    letter-spacing: 2px;
    cursor: pointer;
}

/* 协议同意 */
.login__agree {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-top: 20px;
    padding: 0 4px;
}

.login__checkbox {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    margin: 3px 2px 0 0;
    border: 1px solid #c3b5d2;
    border-radius: 50%;
    background: transparent;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

.login__checkbox:checked {
    border-color: #a78fd8;
    background: #a78fd8;
}

.login__agree-text {
    flex: 0 1 auto;
    margin: 0 0 0 2px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.7;
    color: #999999;
    cursor: pointer;
}

.login__agree-text a {
    color: #CB74E8;
    text-decoration: none;
}

/* 加载中状态 */
.login__submit--loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* 备案号：定位到页面底部 */
.login__beian {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    /* 不支持 env() 的老浏览器回退值 */
    padding: 10px 24px;
    /* iOS 11.0-11.2 旧语法 */
    padding: 10px 24px calc(10px + constant(safe-area-inset-bottom));
    padding: 10px 24px calc(10px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    font-size: 12px;
    line-height: 1.6;
    color: #a49bb0;
    text-align: center;
}

.login__beian a {
    color: #a49bb0;
    text-decoration: none;
}

/* 协议确认弹窗 */
.login__dialog {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

.login__dialog--show {
    opacity: 1;
    visibility: visible;
}

.login__dialog-mask {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(58, 48, 78, 0.45);
}

.login__dialog-box {
    position: relative;
    width: 78%;
    max-width: 320px;
    padding: 24px 20px 16px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(120, 90, 160, 0.2);
    text-align: center;
}

.login__dialog-title {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: #433A58;
}

.login__dialog-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.7;
    color: #7c7389;
    text-align: left;
}

.login__dialog-text a {
    color: #CB74E8;
    text-decoration: none;
}

.login__dialog-btns {
    display: flex;
    align-items: center;
    margin-top: 20px;
}

.login__dialog-btn {
    flex: 1;
    height: 42px;
    border: 0;
    border-radius: 21px;
    font-size: 14px;
    cursor: pointer;
}

.login__dialog-btn--cancel {
    margin-right: 10px;
    background: #f3eef7;
    color: #8a819a;
}

.login__dialog-btn--ok {
    background: linear-gradient(142deg, #EDDBF6 0%, #B085F4 100%);
    color: #fff;
}

/* 轻提示 */
.login__toast {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 9999;
    max-width: 70%;
    padding: 10px 18px;
    border-radius: 8px;
    background: rgba(58, 48, 78, 0.9);
    font-size: 14px;
    line-height: 1.5;
    color: #fff;
    text-align: center;
    transform: translate(-50%, -50%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

.login__toast--show {
    opacity: 1;
    visibility: visible;
}
