/* Apotiva Pro authentication experience */

:root {
    --auth-deep-green: #2f6e5a;
    --auth-dark-moss: #233c35;
    --auth-sage-mint: #bfd7cf;
    --auth-sand-beige: #f0d7a7;
    --auth-warm-stone: #eae6df;
    --auth-ink: #172c26;
    --auth-body: #4a5d56;
    --auth-muted: #65756f;
    --auth-border: #d8e2de;
    --auth-surface: #ffffff;
    --auth-soft: #f5f8f7;
}

html,
body.apotiva-auth-page {
    min-height: 100%;
    margin: 0;
}

body.apotiva-auth-page {
    overflow-x: hidden;
    background: var(--auth-warm-stone);
    color: var(--auth-ink);
    font-family: "Instrument Sans", "Inter", sans-serif;
}

.apotiva-auth-page *,
.apotiva-auth-page *::before,
.apotiva-auth-page *::after {
    box-sizing: border-box;
}

.apotiva-auth-page .login-page-background {
    min-height: 100vh;
    min-height: 100svh;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background-color: var(--login-bg-color, var(--auth-warm-stone));
}

.apotiva-auth-page .login-page-background::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(135deg, rgba(234, 230, 223, 0.92), rgba(191, 215, 207, 0.82)),
        var(--login-bg-image, none);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.apotiva-auth-page .login-page-background::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 12%, rgba(240, 215, 167, 0.58), transparent 25%),
        radial-gradient(circle at 88% 86%, rgba(47, 110, 90, 0.18), transparent 30%);
}

.apotiva-auth-shell {
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    padding: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.apotiva-auth-card {
    width: min(1080px, 100%);
    min-height: 650px;
    display: grid;
    grid-template-columns: minmax(340px, 0.82fr) minmax(500px, 1.18fr);
    overflow: hidden;
    background: var(--auth-surface);
    border: 1px solid rgba(35, 60, 53, 0.1);
    border-radius: 28px;
    box-shadow: 0 30px 70px rgba(35, 60, 53, 0.18);
}

.apotiva-auth-brand {
    min-width: 0;
    padding: 54px 46px 44px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #ffffff;
    background:
        radial-gradient(circle at 100% 0%, rgba(240, 215, 167, 0.22), transparent 30%),
        linear-gradient(150deg, var(--auth-dark-moss) 0%, var(--auth-deep-green) 100%);
}

.apotiva-auth-brand::before,
.apotiva-auth-brand::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    pointer-events: none;
}

.apotiva-auth-brand::before {
    width: 330px;
    height: 330px;
    right: -190px;
    top: 160px;
}

.apotiva-auth-brand::after {
    width: 220px;
    height: 220px;
    right: -130px;
    top: 215px;
}

.apotiva-auth-brand-decoration {
    width: 90px;
    height: 90px;
    position: absolute;
    right: 42px;
    top: 46px;
    border-radius: 24px;
    transform: rotate(16deg);
    background: rgba(240, 215, 167, 0.16);
    border: 1px solid rgba(240, 215, 167, 0.32);
}

.apotiva-auth-brand-content,
.apotiva-auth-security-note {
    position: relative;
    z-index: 2;
}

.apotiva-auth-brand-content {
    margin-top: 126px;
}

.apotiva-auth-kicker {
    min-height: 36px;
    padding: 7px 12px;
    margin-bottom: 22px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-dark-moss);
    background: var(--auth-sand-beige);
    border-radius: 999px;
    font-size: 0.83rem;
    line-height: 1.3;
    font-weight: 700;
}

.apotiva-auth-brand h2 {
    max-width: 360px;
    margin: 0 0 18px;
    color: #ffffff;
    font-family: "Instrument Sans", "Inter", sans-serif;
    font-size: clamp(2rem, 3vw, 2.75rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
    font-weight: 720;
    text-wrap: balance;
}

.apotiva-auth-brand p {
    max-width: 360px;
    margin: 0;
    color: #dce9e5;
    font-size: 0.98rem;
    line-height: 1.75;
}

.apotiva-auth-security-note {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 13px;
    background: rgba(14, 38, 30, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
}

.apotiva-auth-security-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--auth-dark-moss);
    background: var(--auth-sand-beige);
    border-radius: 12px;
}

.apotiva-auth-security-note strong,
.apotiva-auth-security-note div > span {
    display: block;
}

.apotiva-auth-security-note .apotiva-auth-security-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.apotiva-auth-security-note strong {
    margin-bottom: 2px;
    color: #ffffff !important;
    font-size: 0.88rem;
}

.apotiva-auth-security-note div > span {
    color: #dce8e4 !important;
    font-size: 0.78rem;
    line-height: 1.45;
}

.apotiva-auth-form-panel {
    min-width: 0;
    padding: 48px clamp(46px, 6vw, 76px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
}

.apotiva-auth-form-inner {
    width: 100%;
    max-width: 500px;
}

.apotiva-auth-page .auth-card-logo {
    width: fit-content;
    max-width: 100%;
    min-height: 70px;
    margin: 0 auto 30px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: #faf9f6;
    border: 1px solid #eee9e0;
    border-radius: 14px;
}

.apotiva-auth-page .auth-card-logo img {
    display: block;
    width: auto;
    max-width: 290px;
    max-height: 82px;
    object-fit: contain;
}

.apotiva-auth-heading {
    margin-bottom: 30px;
    text-align: center;
}

.apotiva-auth-heading h1 {
    margin: 0 0 10px;
    color: var(--auth-ink);
    font-family: "Instrument Sans", "Inter", sans-serif;
    font-size: clamp(1.85rem, 3vw, 2.35rem);
    line-height: 1.18;
    letter-spacing: -0.035em;
    font-weight: 720;
}

.apotiva-auth-heading p {
    max-width: 440px;
    margin: 0 auto;
    color: var(--auth-muted);
    font-size: 0.98rem;
    line-height: 1.65;
}

.apotiva-auth-field {
    margin-bottom: 19px;
}

.apotiva-auth-field > label {
    margin-bottom: 7px;
    display: block;
    color: #263a33;
    font-size: 0.9rem;
    line-height: 1.4;
    font-weight: 650;
}

.apotiva-auth-form .input-group {
    min-height: 54px;
    margin: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #cbd8d3;
    border-radius: 13px;
    transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.apotiva-auth-form .input-group:focus-within {
    border-color: var(--auth-deep-green);
    box-shadow: 0 0 0 4px rgba(47, 110, 90, 0.13);
}

.apotiva-auth-form .input-group:has(.error) {
    border-color: #b42318;
}

.apotiva-auth-form .apotiva-input-icon {
    width: 52px;
    flex: 0 0 52px;
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #52645d;
    background: var(--auth-soft);
    border-right: 1px solid #dce5e1;
    transform: none;
}

.apotiva-auth-form .form-control {
    width: 100%;
    min-width: 0;
    height: 52px;
    margin: 0 !important;
    padding: 12px 15px !important;
    color: var(--auth-ink);
    background: #ffffff;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-size: 1rem;
    line-height: 1.5;
}

.apotiva-auth-form .form-control::placeholder {
    color: #77857f !important;
    opacity: 1;
}

.apotiva-password-toggle {
    width: 52px;
    min-width: 52px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: static;
    color: #52645d;
    background: #ffffff;
    border: 0;
    cursor: pointer;
    transform: none;
}

.apotiva-password-toggle img {
    width: 19px;
    height: 19px;
    object-fit: contain;
}

.apotiva-password-toggle img:last-child {
    display: none;
}

.apotiva-password-toggle.show-pass img:first-child {
    display: none;
}

.apotiva-password-toggle.show-pass img:last-child {
    display: block;
}

.apotiva-auth-options {
    min-height: 44px;
    margin: -2px 0 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.apotiva-auth-options .custom-control-label {
    min-height: 44px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    color: var(--auth-body);
    cursor: pointer;
}

.apotiva-auth-options input[type="checkbox"] {
    width: 19px;
    height: 19px;
    margin: 0 8px 0 0;
    flex: 0 0 19px;
    accent-color: var(--auth-deep-green) !important;
    cursor: pointer;
}

.apotiva-auth-options span,
.apotiva-auth-options a {
    color: var(--auth-body);
    font-size: 0.92rem;
    line-height: 1.45;
}

.apotiva-auth-options a,
.apotiva-auth-footer-links a {
    color: #285f4d;
    font-weight: 650;
    text-decoration: none;
    transition: color 180ms ease;
}

.apotiva-auth-options a:hover,
.apotiva-auth-footer-links a:hover {
    color: var(--auth-dark-moss);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.apotiva-auth-form .login-btn {
    width: 100%;
    min-height: 52px;
    margin-top: 8px;
    padding: 13px 22px;
    color: #ffffff !important;
    background: var(--auth-deep-green) !important;
    border: 1px solid var(--auth-deep-green) !important;
    border-radius: 13px;
    box-shadow: 0 10px 22px rgba(47, 110, 90, 0.2);
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 700;
    transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.apotiva-auth-form .login-btn:hover {
    color: #ffffff !important;
    background: var(--auth-dark-moss) !important;
    border-color: var(--auth-dark-moss) !important;
    transform: translateY(-2px);
    box-shadow: 0 14px 26px rgba(35, 60, 53, 0.24);
}

.apotiva-auth-footer-links {
    margin-top: 22px;
    padding-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid #e3e9e6;
}

.apotiva-auth-footer-links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.9rem;
}

.apotiva-auth-footer-single {
    justify-content: center;
}

.apotiva-auth-page a:focus-visible,
.apotiva-auth-page button:focus-visible,
.apotiva-auth-page input:focus-visible {
    outline: 3px solid #c68a20 !important;
    outline-offset: 3px;
}

.apotiva-auth-page .error-alert,
.apotiva-auth-page label.error {
    margin-top: 6px;
    color: #b42318 !important;
    font-size: 0.8rem;
    line-height: 1.4;
}

@media (max-width: 980px) {
    .apotiva-auth-shell {
        padding: 24px;
    }

    .apotiva-auth-card {
        grid-template-columns: minmax(300px, 0.72fr) minmax(450px, 1.28fr);
    }

    .apotiva-auth-brand {
        padding-left: 34px;
        padding-right: 34px;
    }

    .apotiva-auth-form-panel {
        padding-left: 40px;
        padding-right: 40px;
    }
}

@media (max-width: 820px) {
    .apotiva-auth-shell {
        padding: 22px;
    }

    .apotiva-auth-card {
        width: min(600px, 100%);
        min-height: 0;
        display: block;
    }

    .apotiva-auth-brand {
        display: none;
    }

    .apotiva-auth-form-panel {
        min-height: 640px;
        padding: 44px 48px;
    }
}

@media (max-width: 575.98px) {
    .apotiva-auth-shell {
        min-height: 100svh;
        padding: 14px;
    }

    .apotiva-auth-card {
        border-radius: 20px;
        box-shadow: 0 18px 42px rgba(35, 60, 53, 0.16);
    }

    .apotiva-auth-form-panel {
        min-height: calc(100svh - 28px);
        padding: 30px 20px;
    }

    .apotiva-auth-page .auth-card-logo {
        min-height: 62px;
        margin-bottom: 24px;
        padding: 8px 12px;
    }

    .apotiva-auth-page .auth-card-logo img {
        max-width: 245px;
        max-height: 72px;
    }

    .apotiva-auth-heading {
        margin-bottom: 25px;
    }

    .apotiva-auth-heading h1 {
        font-size: 1.72rem;
    }

    .apotiva-auth-heading p {
        font-size: 0.92rem;
    }

    .apotiva-auth-options {
        align-items: flex-start;
        gap: 10px;
    }

    .apotiva-auth-options a {
        padding-top: 11px;
        text-align: right;
    }

    .apotiva-auth-footer-links {
        flex-direction: column;
        gap: 2px;
    }
}

@media (max-width: 380px) {
    .apotiva-auth-shell {
        padding: 8px;
    }

    .apotiva-auth-form-panel {
        min-height: calc(100svh - 16px);
        padding: 24px 16px;
    }

    .apotiva-auth-options span,
    .apotiva-auth-options a,
    .apotiva-auth-footer-links a {
        font-size: 0.84rem;
    }
}

@media (max-height: 760px) and (min-width: 821px) {
    .apotiva-auth-shell {
        align-items: flex-start;
        padding-top: 22px;
        padding-bottom: 22px;
    }

    .apotiva-auth-card {
        min-height: 610px;
    }

    .apotiva-auth-brand-content {
        margin-top: 94px;
    }

    .apotiva-auth-form-panel {
        padding-top: 34px;
        padding-bottom: 34px;
    }
}

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