:root {
    --auth-page: #f5f2ed;
    --auth-page-soft: #faf8f4;
    --auth-card: #ffffff;
    --auth-panel: #eee5d8;
    --auth-panel-deep: #e2d1bb;
    --auth-text: #292724;
    --auth-muted: #817970;
    --auth-border: #e6ded4;
    --auth-input: #fbfaf8;
    --auth-accent: #bd996a;
    --auth-accent-hover: #a98457;
    --auth-soft: #f3eee7;
    --auth-shadow: rgba(66, 49, 27, 0.10);
    --auth-danger-bg: #fff3f1;
    --auth-danger-text: #a84f45;
    --auth-success-bg: #eff7f0;
    --auth-success-text: #47764e;
}

html[data-theme="dark"] {
    color-scheme: dark;

    --auth-page: #151412;
    --auth-page-soft: #1c1a17;
    --auth-card: #24211d;
    --auth-panel: #302a23;
    --auth-panel-deep: #3b3127;
    --auth-text: #eee9e2;
    --auth-muted: #aaa198;
    --auth-border: #464038;
    --auth-input: #2b2824;
    --auth-accent: #bf9867;
    --auth-accent-hover: #d0a873;
    --auth-soft: #312d28;
    --auth-shadow: rgba(0, 0, 0, 0.34);
    --auth-danger-bg: #3c2724;
    --auth-danger-text: #efaaa1;
    --auth-success-bg: #233429;
    --auth-success-text: #9bc4a1;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--auth-page) !important;
}

body {
    color: var(--auth-text);
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "PingFang SC",
        "Microsoft YaHei",
        Arial,
        sans-serif;
}

body > div.min-h-screen {
    background: transparent !important;
}

.aicm-password-page,
.aicm-password-page * {
    box-sizing: border-box;
}

.aicm-password-page {
    min-height: 100vh;
    color: var(--auth-text);
    background:
        radial-gradient(
            circle at 25% 15%,
            var(--auth-page-soft) 0,
            var(--auth-page) 56%
        );
}

.aicm-password-topbar {
    height: 82px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--auth-border);
    background: var(--auth-card);
}

.aicm-password-topbar-inner {
    width: calc(100% - 48px);
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.aicm-password-logo {
    color: var(--auth-text);
    font-size: 23px;
    font-weight: 500;
    letter-spacing: 4px;
    text-decoration: none;
    white-space: nowrap;
}

.aicm-password-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.aicm-password-home {
    height: 42px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    color: var(--auth-text);
    border-radius: 11px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
}

.aicm-password-home:hover {
    color: var(--auth-accent-hover);
    background: var(--auth-soft);
}

.aicm-theme-picker {
    position: relative;
}

.aicm-theme-button {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--auth-muted);
    border: 1px solid var(--auth-border);
    border-radius: 11px;
    background: var(--auth-card);
    cursor: pointer;
}

.aicm-theme-button:hover {
    color: var(--auth-accent-hover);
    border-color: var(--auth-accent);
    background: var(--auth-soft);
}

.aicm-theme-menu {
    position: absolute;
    top: calc(100% + 11px);
    right: 0;
    z-index: 80;
    width: 148px;
    padding: 7px;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);
    border: 1px solid var(--auth-border);
    border-radius: 14px;
    background: var(--auth-card);
    box-shadow: 0 18px 44px var(--auth-shadow);
    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        visibility 0.18s ease;
}

.aicm-theme-menu.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.aicm-theme-option {
    width: 100%;
    height: 42px;
    padding: 0 11px;
    display: grid;
    grid-template-columns: 22px 1fr 17px;
    align-items: center;
    gap: 7px;
    color: var(--auth-muted);
    border: 0;
    border-radius: 9px;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.aicm-theme-option:hover {
    color: var(--auth-text);
    background: var(--auth-soft);
}

.aicm-theme-option.is-active {
    color: var(--auth-accent-hover);
    background: var(--auth-soft);
}

.aicm-theme-check {
    opacity: 0;
    font-size: 11px;
}

.aicm-theme-option.is-active .aicm-theme-check {
    opacity: 1;
}

.aicm-password-main {
    min-height: calc(100vh - 82px);
    padding: 54px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aicm-password-card {
    width: 100%;
    max-width: 1080px;
    min-height: 570px;
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    overflow: hidden;
    border: 1px solid var(--auth-border);
    border-radius: 26px;
    background: var(--auth-card);
    box-shadow:
        0 24px 65px var(--auth-shadow),
        0 3px 10px rgba(50, 38, 23, 0.04);
}

.aicm-password-brand {
    position: relative;
    min-height: 570px;
    padding: 58px 52px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        linear-gradient(
            145deg,
            var(--auth-panel) 0%,
            var(--auth-panel-deep) 100%
        );
}

.aicm-password-brand::before,
.aicm-password-brand::after {
    content: "";
    position: absolute;
    border: 1px solid var(--auth-accent);
    border-radius: 50%;
    opacity: 0.35;
}

.aicm-password-brand::before {
    width: 320px;
    height: 320px;
    right: -130px;
    top: -120px;
}

.aicm-password-brand::after {
    width: 210px;
    height: 210px;
    left: -95px;
    bottom: -85px;
}

.aicm-password-brand-content,
.aicm-password-brand-list {
    position: relative;
    z-index: 2;
}

.aicm-password-kicker {
    margin-bottom: 22px;
    color: var(--auth-accent-hover);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 3px;
}

.aicm-password-brand-title {
    max-width: 390px;
    margin: 0;
    color: var(--auth-text);
    font-size: clamp(35px, 3.5vw, 49px);
    font-weight: 700;
    line-height: 1.22;
}

.aicm-password-brand-description {
    max-width: 390px;
    margin: 24px 0 0;
    color: var(--auth-muted);
    font-size: 16px;
    line-height: 1.85;
}

.aicm-password-brand-list {
    display: grid;
    gap: 15px;
}

.aicm-password-brand-item {
    display: flex;
    align-items: center;
    gap: 13px;
    color: var(--auth-muted);
    font-size: 14px;
}

.aicm-password-brand-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--auth-accent-hover);
    border-radius: 50%;
    background: var(--auth-card);
}

.aicm-password-form-panel {
    min-height: 570px;
    padding: 58px 70px;
    display: flex;
    align-items: center;
    background: var(--auth-card);
}

.aicm-password-form-inner {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
}

.aicm-password-heading {
    margin-bottom: 32px;
}

.aicm-password-title {
    margin: 0;
    color: var(--auth-text);
    font-size: 34px;
    font-weight: 700;
    line-height: 1.3;
}

.aicm-password-subtitle {
    margin: 10px 0 0;
    color: var(--auth-muted);
    font-size: 15px;
    line-height: 1.75;
}

.aicm-password-alert {
    margin-bottom: 20px;
    padding: 13px 15px;
    border-radius: 11px;
    font-size: 13px;
    line-height: 1.65;
}

.aicm-password-alert-success {
    color: var(--auth-success-text);
    background: var(--auth-success-bg);
}

.aicm-password-alert-error {
    color: var(--auth-danger-text);
    background: var(--auth-danger-bg);
}

.aicm-password-alert-error ul {
    margin: 0;
    padding-left: 18px;
}

.aicm-password-field {
    margin-bottom: 20px;
}

.aicm-password-label {
    margin-bottom: 8px;
    display: block;
    color: var(--auth-text);
    font-size: 13px;
    font-weight: 600;
}

.aicm-password-input-wrap {
    position: relative;
}

.aicm-password-input {
    width: 100%;
    height: 54px;
    padding: 0 16px;
    color: var(--auth-text);
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    outline: none;
    background: var(--auth-input);
    font-size: 15px;
}

.aicm-password-input:focus {
    border-color: var(--auth-accent);
    background: var(--auth-card);
    box-shadow: 0 0 0 4px rgba(189, 153, 106, 0.14);
}

.aicm-password-input.has-toggle {
    padding-right: 52px;
}

.aicm-password-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--auth-muted);
    border: 0;
    border-radius: 9px;
    background: transparent;
    transform: translateY(-50%);
    cursor: pointer;
}

.aicm-password-toggle:hover {
    color: var(--auth-accent-hover);
    background: var(--auth-soft);
}

.aicm-password-submit {
    width: 100%;
    height: 54px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    border: 1px solid var(--auth-accent) !important;
    border-radius: 12px;
    background: var(--auth-accent) !important;
    box-shadow: 0 8px 20px rgba(189, 153, 106, 0.24);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.aicm-password-submit:hover {
    color: #ffffff !important;
    border-color: var(--auth-accent-hover) !important;
    background: var(--auth-accent-hover) !important;
    transform: translateY(-1px);
}

.aicm-password-back {
    margin-top: 22px;
    text-align: center;
}

.aicm-password-back a {
    color: var(--auth-muted);
    font-size: 13px;
    text-decoration: none;
}

.aicm-password-back a:hover {
    color: var(--auth-accent-hover);
}

@media (max-width: 900px) {
    .aicm-password-card {
        max-width: 650px;
        grid-template-columns: 1fr;
    }

    .aicm-password-brand {
        min-height: auto;
        padding: 42px;
    }

    .aicm-password-brand-list {
        margin-top: 32px;
        grid-template-columns: repeat(3, 1fr);
    }

    .aicm-password-brand-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .aicm-password-form-panel {
        min-height: auto;
        padding: 50px 56px 58px;
    }
}

@media (max-width: 640px) {
    .aicm-password-topbar {
        height: 70px;
    }

    .aicm-password-topbar-inner {
        width: calc(100% - 28px);
    }

    .aicm-password-logo {
        font-size: 18px;
        letter-spacing: 3px;
    }

    .aicm-password-home {
        display: none;
    }

    .aicm-password-main {
        min-height: calc(100vh - 70px);
        padding: 24px 14px 40px;
        align-items: flex-start;
    }

    .aicm-password-card {
        border-radius: 19px;
    }

    .aicm-password-brand {
        padding: 34px 26px;
    }

    .aicm-password-brand-title {
        font-size: 32px;
    }

    .aicm-password-brand-list {
        grid-template-columns: 1fr;
    }

    .aicm-password-brand-item {
        align-items: center;
        flex-direction: row;
    }

    .aicm-password-form-panel {
        padding: 38px 25px 44px;
    }

    .aicm-password-title {
        font-size: 29px;
    }
}
