:root {
    --ink: #2b2318;
    --ink-soft: #5a4d3a;
    --ink-muted: #8a7c66;
    --brand: #33471d;
    --brand-dark: #263410;
    --brand-bright: #4a6329;
    --glass-bg-top: rgba(255, 255, 255, 0.16);
    --glass-bg-bottom: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.8);
    --field-fill: rgba(255, 255, 255, 0.42);
    --shadow-color: rgba(43, 35, 24, 0.22);
    --icon-eye: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
    --icon-eye-off: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.9 4.24A9.6 9.6 0 0 1 12 4c7 0 11 7 11 7a13 13 0 0 1-3.16 3.94M6.1 6.1C3.2 7.9 1 12 1 12s4 7 11 7a9.6 9.6 0 0 0 4.9-1.35'/%3E%3Cpath d='M14.12 14.12a3 3 0 1 1-4.24-4.24'/%3E%3Cpath d='M2 2l20 20'/%3E%3C/svg%3E");
}

html,
body {
    min-height: 100%;
}

body.alis-login-page {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: #f7efe0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow-x: hidden;
}

body.alis-login-page::before {
    content: "";
    position: fixed;
    inset: -12%;
    z-index: 0;
    background:
        radial-gradient(36% 36% at 16% 20%, rgba(51, 71, 29, 0.28), transparent 70%),
        radial-gradient(42% 42% at 84% 14%, rgba(220, 140, 40, 0.32), transparent 70%),
        radial-gradient(46% 46% at 78% 86%, rgba(140, 60, 20, 0.16), transparent 70%),
        radial-gradient(38% 38% at 12% 88%, rgba(249, 233, 203, 0.6), transparent 70%),
        linear-gradient(160deg, #faf3e6 0%, #f3e8d4 55%, #f7efe0 100%);
    filter: blur(6px) saturate(120%);
    animation: alisMeshDrift 26s ease-in-out infinite alternate;
    pointer-events: none;
}

body.alis-login-page::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    background: url("../images/logo-mark.png") center / min(92vw, 1500px) auto no-repeat;
    opacity: 0.16;
    pointer-events: none;
}

@media (max-width: 700px) {
    body.alis-login-page::after {
        background-size: 720px auto;
    }
}

@keyframes alisMeshDrift {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    100% {
        transform: translate3d(-2.5%, 2.5%, 0) scale(1.06);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.alis-login-page::before {
        animation: none;
    }
}

.alis-login-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 20px;
    background: transparent;
}

.alis-login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: transparent;
    perspective: 1400px;
}

.alis-login-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 420px;
    padding: 44px 40px 34px;
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    background: linear-gradient(165deg, var(--glass-bg-top), var(--glass-bg-bottom));
    -webkit-backdrop-filter: blur(7px) saturate(170%);
    backdrop-filter: blur(7px) saturate(170%);
    box-shadow:
        0 34px 70px -22px var(--shadow-color),
        0 1px 0 rgba(255, 255, 255, 0.95) inset,
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    animation: alisCardIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.alis-login-card::before {
    content: "";
    position: absolute;
    top: -40%;
    left: -30%;
    width: 45%;
    height: 220%;
    background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.65), transparent);
    transform: rotate(18deg);
    animation: alisShine 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes alisShine {
    0%,
    24% {
        left: -40%;
    }
    62%,
    100% {
        left: 130%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .alis-login-card::before {
        animation: none;
        display: none;
    }
}

@keyframes alisCardIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .alis-login-card {
        animation: none;
    }
}

.alis-system-brand {
    text-align: center;
    margin-bottom: 28px;
}

.alis-logo-tile {
    width: 96px;
    height: 96px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5ecd8;
    border-radius: 50%;
    box-shadow:
        0 12px 26px -10px rgba(43, 35, 24, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    overflow: hidden;
}

.alis-system-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
}

.alis-system-brand p:last-child {
    margin: 6px 0 0;
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.5;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.6);
}

.alis-login-card .alert {
    border: 1px solid rgba(255, 59, 48, 0.22);
    border-radius: 14px;
    margin-bottom: 18px;
    background: rgba(255, 59, 48, 0.08);
    color: #a8271f;
    font-size: 14px;
}

.alis-login-card .alert ul {
    margin: 0;
    padding-left: 18px;
}

.alis-login-form {
    margin: 0;
}

.alis-form-group {
    margin-bottom: 16px;
}

.alis-form-group label {
    display: block;
    float: none;
    width: auto;
    margin-bottom: 8px;
    color: var(--ink-soft);
    font-weight: 600;
}

.alis-floating-field label {
    position: absolute;
    left: 18px;
    top: 50%;
    z-index: 3;
    margin: 0;
    padding: 0;
    width: auto;
    max-width: calc(100% - 36px);
    transform: translateY(-50%);
    color: var(--ink-muted);
    background: transparent;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.2;
    pointer-events: none;
    transition: top 0.16s ease, font-size 0.16s ease, color 0.16s ease, font-weight 0.16s ease;
}

.alis-input-wrap {
    position: relative;
}

.alis-input-wrap .form-control {
    float: none;
    width: 100%;
    height: 54px;
    padding: 20px 16px 6px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
    color: var(--ink);
    background: var(--field-fill);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    font-size: 16px;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.alis-input-wrap input[type="password"],
.alis-input-wrap input[type="text"]#password {
    padding-right: 48px;
}

.alis-input-wrap .form-control:focus {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(51, 71, 29, 0.35);
    box-shadow: 0 0 0 4px rgba(51, 71, 29, 0.14);
    outline: none;
}

.alis-floating-field .form-control:focus + label,
.alis-floating-field .form-control:not(:placeholder-shown) + label {
    top: 15px;
    color: var(--brand);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.alis-password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    z-index: 4;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
}

.alis-password-toggle:hover,
.alis-password-toggle:focus {
    background: rgba(51, 71, 29, 0.1);
    outline: none;
}

.alis-eye-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: var(--ink-muted);
    -webkit-mask-image: var(--icon-eye);
    mask-image: var(--icon-eye);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    transition: background-color 0.15s ease;
}

.alis-password-toggle[aria-pressed="true"] .alis-eye-icon {
    -webkit-mask-image: var(--icon-eye-off);
    mask-image: var(--icon-eye-off);
    background-color: var(--brand);
}

.alis-actions {
    margin-top: 22px;
}

.alis-login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(180deg, var(--brand-bright), var(--brand-dark));
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-align: center;
    box-shadow:
        0 16px 30px -12px rgba(38, 52, 16, 0.55),
        0 1px 0 rgba(255, 255, 255, 0.25) inset;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.alis-login-button:hover,
.alis-login-button:focus {
    background: linear-gradient(180deg, #5a7a34, var(--brand-dark));
    color: #fff;
    transform: translateY(-1px);
    box-shadow:
        0 20px 36px -12px rgba(38, 52, 16, 0.6),
        0 1px 0 rgba(255, 255, 255, 0.25) inset;
}

.alis-login-button:active {
    transform: translateY(0) scale(0.98);
    box-shadow:
        0 8px 18px -8px rgba(38, 52, 16, 0.5),
        0 1px 0 rgba(255, 255, 255, 0.25) inset;
}

.alis-login-footer {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    color: var(--ink-muted);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.6);
}

.alis-login-footer a {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--brand);
    font-weight: 600;
}

.alis-login-footer p {
    margin: 0;
}

@media (max-width: 860px) {
    body.alis-login-page::before {
        filter: blur(4px) saturate(110%);
    }

    .alis-login-shell {
        padding: 18px;
    }

    .alis-login-card {
        max-width: none;
        padding: 32px 26px 26px;
        border-radius: 24px;
    }
}
