/* ???????????????????????? ui_foundation.css? */
body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.5), transparent 30%),
        radial-gradient(circle at 88% 80%, rgba(47, 116, 109, 0.1), transparent 28%),
        linear-gradient(145deg, var(--bg-start), var(--bg-end));
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

.icon {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
    align-items: center;
    gap: clamp(42px, 8vw, 112px);
    width: min(1120px, calc(100% - 64px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 56px 0;
}

.intro-panel {
    max-width: 560px;
}

.brand-mark {
    display: grid;
    width: 72px;
    height: 72px;
    margin-bottom: 42px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 24px;
    color: var(--primary);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    place-items: center;
}

.brand-mark .icon {
    width: 34px;
    height: 34px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.14em;
}

h1,
h2,
p {
    overflow-wrap: anywhere;
}

h1 {
    max-width: 11em;
    margin: 0;
    font-size: clamp(2.35rem, 5vw, 4.5rem);
    font-weight: 720;
    letter-spacing: -0.055em;
    line-height: 1.08;
}

.intro-copy {
    max-width: 34rem;
    margin: 24px 0 0;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.8;
}

.privacy-note {
    display: flex;
    gap: 14px;
    max-width: 32rem;
    margin-top: 42px;
    padding: 18px 20px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    box-shadow: var(--shadow-small);
}

.privacy-note > .icon {
    margin-top: 2px;
    color: var(--primary);
}

.privacy-note strong,
.privacy-note span {
    display: block;
}

.privacy-note strong {
    margin-bottom: 5px;
    font-size: 0.92rem;
}

.privacy-note span {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.55;
}

.login-card {
    padding: clamp(28px, 5vw, 48px);
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 34px;
}

.card-heading h2 {
    margin: 0;
    font-size: 1.9rem;
    letter-spacing: -0.035em;
}

.icon-button,
.password-toggle {
    display: inline-grid;
    border: 0;
    background: var(--surface);
    cursor: pointer;
    place-items: center;
    transition: transform var(--ease), box-shadow var(--ease), color var(--ease);
}

.icon-button {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    color: var(--text-muted);
    box-shadow: var(--shadow-small);
}

.icon-button:hover,
.icon-button:focus-visible {
    color: var(--primary);
    box-shadow: 8px 8px 18px var(--shadow-dark), -8px -8px 18px var(--highlight);
    transform: translateY(-2px);
}

.icon-button:active {
    box-shadow: var(--shadow-inset);
    transform: translateY(1px);
}

.field-group {
    margin-bottom: 22px;
}

.field-group label {
    display: inline-block;
    margin: 0 0 9px 4px;
    font-size: 0.88rem;
    font-weight: 700;
}

.input-shell {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 58px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    background: var(--surface);
    box-shadow: var(--shadow-inset);
    transition: box-shadow var(--ease), border-color var(--ease);
}

.input-shell:focus-within {
    border-color: var(--primary);
    box-shadow: var(--shadow-inset), 0 0 0 4px var(--focus);
}

.input-shell.is-invalid {
    border-color: var(--danger);
}

.input-shell input {
    width: 100%;
    min-width: 0;
    padding: 17px 0;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
}

.input-shell input::placeholder {
    color: color-mix(in srgb, var(--text-muted) 75%, transparent);
}

.password-toggle {
    width: 38px;
    height: 38px;
    margin-right: -6px;
    border-radius: 12px;
    color: var(--text-muted);
    box-shadow: none;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--primary);
    box-shadow: var(--shadow-small);
}

.password-toggle:active {
    box-shadow: var(--shadow-inset);
    transform: translateY(1px);
}

.field-error {
    min-height: 1.15em;
    margin: 7px 4px 0;
    color: var(--danger);
    font-size: 0.78rem;
}

.primary-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 58px;
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: #fff;
    background: var(--primary);
    box-shadow: 7px 7px 17px rgba(31, 78, 72, 0.3), -5px -5px 14px var(--highlight);
    cursor: pointer;
    font-weight: 750;
    transition: transform var(--ease), box-shadow var(--ease), background var(--ease);
}

.primary-button:hover,
.primary-button:focus-visible {
    background: var(--primary-strong);
    box-shadow: 10px 10px 22px rgba(31, 78, 72, 0.32), -6px -6px 16px var(--highlight);
    transform: translateY(-2px);
}

.primary-button:active {
    box-shadow: inset 4px 4px 10px rgba(15, 57, 52, 0.35), inset -3px -3px 8px rgba(255, 255, 255, 0.16);
    transform: translateY(1px);
}

.keyboard-tip {
    margin: 24px 0 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-align: center;
}

kbd {
    padding: 2px 6px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 6px;
    background: var(--surface);
    box-shadow: 3px 3px 8px var(--shadow-dark), -3px -3px 8px var(--highlight);
    font: inherit;
}

.toast-region {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 20;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 32px));
}

.toast {
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-left: 4px solid var(--primary);
    border-radius: 14px;
    color: var(--text);
    background: var(--surface-strong);
    box-shadow: var(--shadow-small);
    font-size: 0.88rem;
    line-height: 1.5;
    animation: toast-in var(--ease) both;
}

.toast.error {
    border-left-color: var(--danger);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr;
        gap: 38px;
        width: min(620px, calc(100% - 40px));
        padding: 48px 0;
    }

    .intro-panel {
        max-width: none;
        text-align: center;
    }

    .brand-mark {
        margin: 0 auto 28px;
    }

    h1,
    .intro-copy,
    .privacy-note {
        margin-right: auto;
        margin-left: auto;
    }
}

@media (max-width: 520px) {
    .login-shell {
        width: min(100% - 24px, 480px);
        gap: 28px;
        padding: 28px 0;
    }

    .brand-mark {
        width: 60px;
        height: 60px;
        border-radius: 20px;
    }

    h1 {
        font-size: clamp(2rem, 11vw, 3rem);
    }

    .intro-copy {
        margin-top: 16px;
        font-size: 0.94rem;
    }

    .privacy-note {
        margin-top: 26px;
        padding: 15px 16px;
        text-align: left;
    }

    .login-card {
        padding: 25px 18px;
        border-radius: 24px;
    }

    .card-heading {
        margin-bottom: 28px;
    }

    .keyboard-tip {
        display: none;
    }

    .toast-region {
        right: 12px;
        bottom: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
