:root {
    --login-bg: #eef2f1;
    --login-surface: #ffffff;
    --login-ink: #17201e;
    --login-muted: #65736f;
    --login-line: #d9e1df;
    --login-brand: #18211f;
    --login-brand-soft: #23302d;
    --login-accent: #138476;
    --login-accent-hover: #0f6d62;
    --login-danger: #b93832;
    --login-danger-bg: #fff1f0;
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

html {
    min-width: 320px;
    background: var(--login-bg);
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--login-bg);
    color: var(--login-ink);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

button,
input {
    font: inherit;
}

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 32px;
}

.auth-frame {
    display: grid;
    width: min(980px, 100%);
    min-height: 570px;
    grid-template-columns: minmax(300px, 0.9fr) minmax(420px, 1.1fr);
    overflow: hidden;
    border: 1px solid var(--login-line);
    border-radius: 8px;
    background: var(--login-surface);
    box-shadow: 0 24px 60px rgba(30, 44, 40, 0.12);
}

.identity-panel {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 38px;
    background: var(--login-brand);
    color: #fff;
}

.identity-panel::after {
    position: absolute;
    inset: auto -42px 66px auto;
    color: rgba(255, 255, 255, 0.035);
    content: "A.A.C";
    font-size: 132px;
    font-weight: 900;
    pointer-events: none;
    white-space: nowrap;
}

.identity-brand {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
}

.identity-brand img,
.mobile-brand img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
}

.identity-brand strong,
.identity-brand span,
.mobile-brand strong,
.mobile-brand span {
    display: block;
}

.identity-brand strong {
    font-size: 20px;
}

.identity-brand span {
    margin-top: 4px;
    color: #a8b7b3;
    font-size: 13px;
}

.identity-copy {
    position: relative;
    z-index: 1;
}

.identity-kicker,
.section-label {
    color: #65cabb;
    font-size: 12px;
    font-weight: 900;
}

.identity-copy h2 {
    max-width: 330px;
    margin: 10px 0 12px;
    font-size: 34px;
    line-height: 1.35;
}

.identity-copy p {
    max-width: 320px;
    margin: 0;
    color: #b8c5c2;
    font-size: 15px;
    line-height: 1.9;
}

.identity-security {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #a8b7b3;
    font-size: 12px;
}

.identity-security svg {
    width: 18px;
    height: 18px;
    color: #65cabb;
}

.login-panel {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    padding: 58px 64px;
}

.mobile-brand {
    display: none;
}

.login-heading {
    margin-bottom: 32px;
}

.login-heading h1 {
    margin: 8px 0 9px;
    font-size: 31px;
    line-height: 1.3;
}

.login-heading p {
    margin: 0;
    color: var(--login-muted);
    font-size: 14px;
}

.form-field {
    margin-bottom: 18px;
}

.form-field label {
    display: block;
    margin-bottom: 8px;
    color: #35423f;
    font-size: 13px;
    font-weight: 800;
}

.input-control {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
    min-height: 50px;
    border: 1px solid #cfd9d6;
    border-radius: 6px;
    background: #fbfcfc;
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.input-control:focus-within {
    border-color: var(--login-accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(19, 132, 118, 0.12);
}

.input-control > svg {
    width: 18px;
    height: 18px;
    justify-self: center;
    margin: 0;
    color: #7b8a86;
    pointer-events: none;
}

.input-control input {
    grid-column: 2;
    width: 100%;
    min-width: 0;
    height: 48px;
    padding: 0 12px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--login-ink);
    font-size: 15px;
}

.input-control input:-webkit-autofill,
.input-control input:-webkit-autofill:hover,
.input-control input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #fbfcfc inset;
    -webkit-text-fill-color: var(--login-ink);
    caret-color: var(--login-ink);
}

.input-control input::placeholder {
    color: #a2adaa;
}

.password-toggle {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    grid-column: 3;
    justify-self: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #71807c;
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--login-accent);
}

.password-toggle svg {
    width: 18px;
    height: 18px;
}

.login-message {
    display: none;
    margin: 2px 0 16px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.6;
}

.login-message.show {
    display: block;
}

.login-message.error {
    border-color: #f0c3bf;
    background: var(--login-danger-bg);
    color: var(--login-danger);
}

.login-message.info {
    border-color: #b9ddd7;
    background: #eef9f7;
    color: #0d6b60;
}

.login-button {
    position: relative;
    display: grid;
    width: 100%;
    min-height: 50px;
    grid-template-columns: minmax(0, 1fr) 20px;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    padding: 11px 18px;
    border: 0;
    border-radius: 6px;
    background: var(--login-accent);
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    transition: background 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.login-button:hover {
    background: var(--login-accent-hover);
    box-shadow: 0 8px 18px rgba(19, 132, 118, 0.2);
    transform: translateY(-1px);
}

.login-button:focus-visible {
    outline: 3px solid rgba(19, 132, 118, 0.22);
    outline-offset: 2px;
}

.login-button:disabled {
    cursor: wait;
    opacity: 0.78;
    transform: none;
}

.login-button svg {
    width: 19px;
    height: 19px;
}

.button-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: login-spin 700ms linear infinite;
}

.login-button.loading .button-arrow {
    display: none;
}

.login-button.loading .button-spinner {
    display: block;
}

.login-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #e4eae8;
    color: #788681;
    font-size: 12px;
    line-height: 1.6;
}

.login-footer svg {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
}

@keyframes login-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 760px) {
    .login-page {
        align-items: start;
        padding: 18px;
    }

    .auth-frame {
        min-height: 0;
        grid-template-columns: 1fr;
    }

    .identity-panel {
        display: none;
    }

    .login-panel {
        min-height: calc(100vh - 36px);
        justify-content: center;
        padding: 34px 28px;
    }

    .mobile-brand {
        display: grid;
        grid-template-columns: 48px minmax(0, 1fr);
        align-items: center;
        gap: 12px;
        margin-bottom: 42px;
        padding-bottom: 18px;
        border-bottom: 1px solid #e4eae8;
    }

    .mobile-brand img {
        width: 48px;
        height: 48px;
    }

    .mobile-brand strong {
        font-size: 16px;
    }

    .mobile-brand span {
        margin-top: 3px;
        color: var(--login-muted);
        font-size: 11px;
    }
}

@media (max-width: 420px) {
    .login-page {
        padding: 0;
    }

    .auth-frame {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .login-panel {
        min-height: 100vh;
        padding: 24px 20px;
    }

    .mobile-brand {
        margin-bottom: 34px;
    }

    .login-heading h1 {
        font-size: 27px;
    }
}

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