:root {
    color-scheme: light;
    --green: #087b63;
    --green-dark: #075c4d;
    --green-soft: #e9f3ef;
    --ink: #203832;
    --muted: #74827d;
    --line: #dce6e1;
    --paper: #fff;
    --canvas: #eef3f0;
}

* {
    box-sizing: border-box;
}

body {
    min-width: 320px;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    display: grid;
    place-items: center;
    padding: 34px 20px;
    overflow-x: hidden;
    background:
        radial-gradient(ellipse at 12% 15%, rgba(47, 124, 97, .08), transparent 31%),
        radial-gradient(ellipse at 89% 86%, rgba(79, 129, 104, .07), transparent 33%),
        var(--canvas);
    color: var(--ink);
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
    position: fixed;
    z-index: -1;
    width: 250px;
    height: 250px;
    border: 1px solid rgba(66, 111, 91, .08);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

body::before {
    top: -142px;
    right: 9%;
}

body::after {
    bottom: -165px;
    left: 7%;
    width: 320px;
    height: 320px;
}

.page-shell {
    width: min(100%, 444px);
    animation: card-enter .55s ease-out both;
}

.login-card {
    position: relative;
    overflow: hidden;
    padding: 38px 42px 35px;
    border: 1px solid rgba(211, 224, 217, .95);
    border-radius: 18px;
    background: var(--paper);
    box-shadow: 0 22px 58px rgba(37, 67, 54, .09), 0 2px 7px rgba(37, 67, 54, .035);
}

.card-top-line {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, #0b604f, #159676 58%, #9acbb5);
}

.brand {
    display: flex;
    justify-content: center;
    margin: 0 auto 33px;
}

.brand-logo {
    display: block;
    width: min(100%, 258px);
    height: auto;
}

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

.eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 11px;
    color: var(--green);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.eyebrow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #159676;
    box-shadow: 0 0 0 3px rgba(21, 150, 118, .10);
}

h1 {
    margin: 0;
    color: var(--ink);
    font-size: 1.7rem;
    font-weight: 650;
    letter-spacing: -.045em;
    line-height: 1.2;
}

.login-description {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.55;
}

.login-form {
    display: grid;
    gap: 18px;
}

.form-field label {
    display: block;
    margin: 0 0 8px 1px;
    color: #314941;
    font-size: .86rem;
    font-weight: 650;
}

.input-frame {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 53px;
    border: 1px solid #d8e2dd;
    border-radius: 10px;
    background: #fbfcfb;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.input-frame:focus-within {
    border-color: #16866c;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(8, 123, 99, .10);
}

.field-icon {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    margin-left: 15px;
    color: #82918b;
}

.input-frame input {
    width: 100%;
    min-width: 0;
    height: 51px;
    padding: 0 13px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: .93rem;
}

.input-frame input::placeholder {
    color: #a1ada7;
}

.password-toggle {
    flex: 0 0 auto;
    margin-right: 11px;
    padding: 5px 2px 5px 8px;
    border: 0;
    background: transparent;
    color: var(--green);
    cursor: pointer;
    font: inherit;
    font-size: .78rem;
    font-weight: 700;
}

.password-toggle:hover {
    color: var(--green-dark);
}

.password-toggle:focus-visible,
.submit-button:focus-visible,
.back-link:focus-visible {
    outline: 3px solid rgba(8, 123, 99, .25);
    outline-offset: 3px;
}

.submit-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    width: 100%;
    min-height: 53px;
    margin-top: 3px;
    border: 1px solid #076d58;
    border-radius: 10px;
    background: linear-gradient(105deg, #0b8067, #086653);
    box-shadow: 0 7px 15px rgba(8, 105, 83, .16), inset 0 1px 0 rgba(255, 255, 255, .14);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: .94rem;
    font-weight: 650;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.submit-button svg {
    width: 18px;
    height: 18px;
    transition: transform .16s ease;
}

.submit-button:hover {
    transform: translateY(-1px);
    background: linear-gradient(105deg, #08745e, #075d4e);
    box-shadow: 0 10px 19px rgba(8, 105, 83, .20), inset 0 1px 0 rgba(255, 255, 255, .14);
}

.submit-button:hover svg {
    transform: translateX(2px);
}

.submit-button:disabled {
    cursor: wait;
    opacity: .8;
}

.credentials-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 2px 0 0;
    color: #87938e;
    font-size: .76rem;
}

.credentials-hint span {
    display: grid;
    width: 15px;
    height: 15px;
    place-items: center;
    border: 1px solid #b9c9c1;
    border-radius: 50%;
    color: #71847a;
    font-size: .62rem;
    font-weight: 700;
}

.form-error {
    margin: -2px 0 0;
    padding: 11px 12px;
    border: 1px solid #f0d5cf;
    border-radius: 8px;
    background: #fff8f6;
    color: #994b3e;
    font-size: .83rem;
    line-height: 1.4;
}

.page-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 19px;
    color: #7e8b85;
    font-size: .76rem;
}

.footer-mark {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #14866d;
}

.footer-separator {
    color: #acb6b1;
}

.success-panel {
    display: grid;
    justify-items: center;
    padding: 7px 0 2px;
    text-align: center;
    animation: card-enter .35s ease-out both;
}

.success-icon {
    display: grid;
    width: 58px;
    height: 58px;
    margin-bottom: 21px;
    place-items: center;
    border: 1px solid #cce3d8;
    border-radius: 50%;
    background: #eef7f2;
    color: var(--green);
}

.success-icon svg {
    width: 32px;
    height: 32px;
}

.success-panel .eyebrow {
    justify-content: center;
}

.success-panel .login-description {
    max-width: 290px;
}

.back-link {
    display: inline-flex;
    justify-content: center;
    margin-top: 25px;
    padding: 12px 17px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--green-dark);
    font-size: .88rem;
    font-weight: 650;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease;
}

.back-link:hover {
    border-color: #c1d7cc;
    background: #f4f8f5;
}

.loading-screen[hidden] {
    display: none;
}

.loading-screen {
    position: fixed;
    z-index: 10;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(28, 47, 40, .34);
    animation: fade-in .16s ease-out both;
}

.loading-card {
    display: grid;
    justify-items: center;
    width: min(100%, 330px);
    padding: 29px 27px 25px;
    border: 1px solid rgba(220, 230, 224, .9);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(23, 49, 38, .19);
    text-align: center;
    animation: card-enter .22s ease-out both;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #dcebe4;
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

.loading-title {
    margin: 17px 0 0;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 700;
}

.loading-caption {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: .82rem;
}

.loading-track {
    width: 100%;
    height: 4px;
    overflow: hidden;
    margin-top: 21px;
    border-radius: 99px;
    background: #e8efeb;
}

.loading-track span {
    display: block;
    width: 37%;
    height: 100%;
    border-radius: inherit;
    background: var(--green);
    animation: progress 1.05s ease-in-out infinite;
}

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

@keyframes progress {
    from { transform: translateX(-110%); }
    to { transform: translateX(330%); }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes card-enter {
    from { opacity: 0; transform: translateY(9px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    body {
        padding: 20px 15px;
    }

    .login-card {
        padding: 31px 25px 29px;
        border-radius: 15px;
    }

    .brand {
        margin-bottom: 29px;
    }

    .brand-logo {
        width: min(100%, 235px);
    }

    h1 {
        font-size: 1.55rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}
