:root {
    --phx-green-900: #005f3a;
    --phx-green-800: #007044;
    --phx-green-700: #078c50;
    --phx-green-600: #0a9a57;
    --phx-green-100: #e8f6ee;
    --phx-green-050: #f4fbf7;
    --phx-text: #17312a;
    --phx-muted: #6d7a76;
    --phx-border: #9acbb2;
    --phx-danger: #b42318;
    --phx-danger-bg: #fff1f0;
    --phx-white: #ffffff;
    --phx-shadow: 0 26px 70px rgba(13, 80, 52, 0.16);
}

* {
    box-sizing: border-box;
}

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

body.phoxanh-login-page {
    min-height: 100vh;
    color: var(--phx-text);
    background: #edf8f1;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.phx-login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(520px, 1.08fr) minmax(520px, 0.92fr);
    overflow: hidden;
}

/* Brand / visual panel */
.phx-brand-panel {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 78% 10%, rgba(112, 202, 150, .32), transparent 24%),
        linear-gradient(145deg, #00663f 0%, #087e4b 38%, #17955a 70%, #4cad7a 100%);
}

.phx-brand-panel::before {
    content: "";
    position: absolute;
    z-index: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 58%;
    background-image: url('../img/phoxanh-login-bg.jpg');
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    transform: scale(1.015);
}

.phx-brand-panel::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 91, 55, .12) 0%, rgba(0, 96, 58, .18) 35%, rgba(0, 67, 40, .18) 55%, rgba(0, 35, 21, .28) 100%),
        linear-gradient(180deg, rgba(0, 100, 61, 1) 0%, rgba(0, 100, 61, .78) 25%, rgba(0, 100, 61, .13) 60%, rgba(0, 61, 37, .08) 100%);
    pointer-events: none;
}

.phx-brand-content {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    padding: clamp(42px, 5vw, 78px) clamp(42px, 5.4vw, 92px);
    display: flex;
    flex-direction: column;
}

.phx-brand-logo {
    display: block;
    width: min(485px, 76%);
    height: auto;
    max-height: 183px;
    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .08));
}

.phx-brand-copy {
    width: min(660px, 94%);
    margin-top: clamp(40px, 6vh, 84px);
}

.phx-brand-rule {
    width: 52px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    margin-bottom: 26px;
}

.phx-brand-title {
    margin: 0;
    font-size: clamp(39px, 3.35vw, 62px);
    line-height: 1.08;
    font-weight: 760;
    letter-spacing: -.035em;
    text-shadow: 0 3px 20px rgba(0, 55, 34, .18);
}

.phx-brand-description {
    max-width: 620px;
    margin: 18px 0 0;
    font-size: clamp(18px, 1.35vw, 25px);
    line-height: 1.5;
    color: rgba(255, 255, 255, .92);
    text-shadow: 0 2px 14px rgba(0, 55, 34, .18);
}

.phx-benefits {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    width: min(670px, 100%);
}

.phx-benefit {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, .96);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    text-shadow: 0 2px 12px rgba(0, 48, 29, .24);
}

.phx-benefit-icon {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, .66);
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(0, 104, 63, .28);
    backdrop-filter: blur(5px);
}

.phx-benefit-icon svg {
    width: 25px;
    height: 25px;
    stroke: currentColor;
}

.phx-brand-spacer {
    flex: 1;
    min-height: 210px;
}

.phx-brand-footer {
    margin-top: auto;
    font-size: 12px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .84);
    text-shadow: 0 1px 7px rgba(0, 44, 26, .4);
}

/* Login panel */
.phx-form-panel {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(28px, 4vw, 70px);
    overflow: hidden;
    background:
        radial-gradient(circle at 100% 30%, rgba(127, 210, 163, .28), transparent 29%),
        radial-gradient(circle at 6% 96%, rgba(121, 204, 156, .18), transparent 25%),
        linear-gradient(150deg, #f7fcf9 0%, #eaf7ef 100%);
}

.phx-form-panel::before,
.phx-form-panel::after {
    content: "";
    position: absolute;
    border-radius: 55% 45% 50% 50%;
    border: 1px solid rgba(28, 151, 88, .14);
    transform: rotate(-28deg);
    pointer-events: none;
}

.phx-form-panel::before {
    width: 280px;
    height: 520px;
    right: -150px;
    top: 18%;
}

.phx-form-panel::after {
    width: 240px;
    height: 420px;
    left: -150px;
    bottom: -120px;
}

.phx-login-card {
    position: relative;
    z-index: 1;
    width: min(100%, 620px);
    padding: clamp(34px, 4vw, 58px) clamp(30px, 4vw, 56px) 34px;
    background: rgba(255, 255, 255, .97);
    border: 1px solid rgba(255, 255, 255, .98);
    border-radius: 28px;
    box-shadow: var(--phx-shadow);
}

.phx-card-logo {
    display: block;
    width: min(390px, 74%);
    height: auto;
    max-height: 148px;
    margin: 0 auto 10px;
    object-fit: contain;
    object-position: center;
}

.phx-card-separator {
    width: 48px;
    height: 3px;
    margin: 16px auto 25px;
    border-radius: 999px;
    background: #b9dfc9;
}

.phx-login-title {
    margin: 0;
    color: var(--phx-green-900);
    text-align: center;
    font-size: clamp(27px, 2vw, 34px);
    line-height: 1.22;
    font-weight: 760;
    letter-spacing: -.025em;
}

.phx-login-subtitle {
    margin: 8px 0 30px;
    text-align: center;
    color: var(--phx-muted);
    font-size: 15px;
    line-height: 1.5;
}

.phx-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid #f4b8b3;
    border-radius: 12px;
    background: var(--phx-danger-bg);
    color: #8f221b;
    font-size: 14px;
    line-height: 1.45;
}

.phx-alert svg {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

.phx-form-group {
    margin-bottom: 20px;
}

.phx-label {
    display: block;
    margin-bottom: 8px;
    color: #132d26;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 700;
}

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

.phx-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    width: 22px;
    height: 22px;
    transform: translateY(-50%);
    color: var(--phx-green-700);
    pointer-events: none;
}

.phx-input-icon svg,
.phx-password-toggle svg,
.phx-submit-icon svg,
.phx-support-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.phx-input {
    width: 100%;
    height: 58px;
    padding: 0 52px 0 50px;
    border: 1.5px solid var(--phx-border);
    border-radius: 12px;
    outline: none;
    color: #17312a;
    background: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    line-height: 58px;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
    box-shadow: inset 0 1px 0 rgba(16, 75, 50, .02);
}

.phx-input::placeholder {
    color: #909b97;
    opacity: 1;
}

.phx-input:hover {
    border-color: #65ad86;
}

.phx-input:focus {
    border-color: var(--phx-green-700);
    box-shadow: 0 0 0 4px rgba(7, 140, 80, .11);
}

.phx-input.is-invalid {
    border-color: #d45c52;
    background: #fffafa;
}

.phx-input.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(180, 35, 24, .09);
}

.phx-password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    color: var(--phx-green-700);
    background: transparent;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}

.phx-password-toggle:hover,
.phx-password-toggle:focus {
    color: var(--phx-green-900);
    background: var(--phx-green-100);
    outline: none;
}

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

.phx-form-meta {
    margin-top: -2px;
    margin-bottom: 20px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.phx-remember {
    display: flex;
    align-items: center;
    min-height: 28px;
}

.phx-remember input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    margin: 0 9px 0 0;
    border: 1.5px solid #6dae8a;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    vertical-align: middle;
}

.phx-remember input[type="checkbox"]::before {
    content: "";
    width: 11px;
    height: 6px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) scale(0);
    transform-origin: center;
    margin-top: -2px;
    transition: transform .12s ease;
}

.phx-remember input[type="checkbox"]:checked {
    border-color: var(--phx-green-700);
    background: var(--phx-green-700);
}

.phx-remember input[type="checkbox"]:checked::before {
    transform: rotate(-45deg) scale(1);
}

.phx-remember input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(7, 140, 80, .11);
}

.phx-remember label {
    margin: 0;
    color: #2a4039;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.phx-forgot-link {
    color: var(--phx-green-800);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-size: 14px;
    font-weight: 700;
}

.phx-forgot-link:hover,
.phx-forgot-link:focus {
    color: #004e30;
    outline: none;
}

.phx-submit {
    width: 100%;
    min-height: 60px;
    border: 0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #fff;
    background: linear-gradient(105deg, #007044 0%, #078c50 100%);
    font-family: inherit;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 750;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(0, 112, 68, .18);
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.phx-submit:hover {
    background: linear-gradient(105deg, #005f3a 0%, #007c49 100%);
    box-shadow: 0 14px 28px rgba(0, 95, 58, .24);
    transform: translateY(-1px);
}

.phx-submit:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(7, 140, 80, .15), 0 14px 28px rgba(0, 95, 58, .22);
}

.phx-submit:active {
    transform: translateY(0);
}

.phx-submit-icon {
    width: 22px;
    height: 22px;
}

.phx-or {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    margin: 22px 0 18px;
    color: #8b9692;
    font-size: 13px;
}

.phx-or::before,
.phx-or::after {
    content: "";
    height: 1px;
    background: #d8e2dd;
}

.phx-support {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 17px;
    border: 1px solid #d8eee2;
    border-radius: 13px;
    background: linear-gradient(120deg, #f0faf4 0%, #e4f5eb 100%);
    scroll-margin-top: 22px;
}

.phx-support-icon {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    color: var(--phx-green-800);
}

.phx-support strong {
    display: block;
    margin-bottom: 2px;
    color: #105f3d;
    font-size: 14px;
}

.phx-support span {
    display: block;
    color: #63726d;
    font-size: 13px;
    line-height: 1.45;
}

.phx-card-footer {
    margin-top: 22px;
    text-align: center;
    color: #91a099;
    font-size: 11px;
    line-height: 1.45;
}

@media (max-width: 1180px) {
    .phx-login-shell {
        grid-template-columns: minmax(470px, .96fr) minmax(510px, 1.04fr);
    }

    .phx-brand-content {
        padding-left: 48px;
        padding-right: 42px;
    }

    .phx-benefits {
        grid-template-columns: 1fr;
        gap: 12px;
        width: 290px;
    }

    .phx-benefit-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }
}

@media (max-width: 980px) {
    .phx-login-shell {
        display: block;
        min-height: 100vh;
    }

    .phx-brand-panel {
        display: none;
    }

    .phx-form-panel {
        min-height: 100vh;
        padding: 28px 18px;
    }

    .phx-login-card {
        width: min(100%, 580px);
    }
}

@media (max-width: 520px) {
    .phx-form-panel {
        padding: 0;
        align-items: stretch;
        background: #f4fbf7;
    }

    .phx-login-card {
        width: 100%;
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        padding: 34px 22px 28px;
        box-shadow: none;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .phx-card-logo {
        width: min(310px, 78%);
        max-height: 118px;
    }

    .phx-login-title {
        font-size: 25px;
    }

    .phx-login-subtitle {
        margin-bottom: 26px;
    }

    .phx-form-meta {
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

.phx-remember label {
    display: inline-flex;
    align-items: center;
}
