* {
    box-sizing: border-box;
}
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}
body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    color: #172033;
    background:
        radial-gradient(
            circle at 12% 18%,
            rgba(39, 60, 117, 0.18),
            transparent 28%
        ),
        radial-gradient(
            circle at 88% 72%,
            rgba(22, 163, 74, 0.16),
            transparent 26%
        ),
        #f5f6fa;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell {
    width: min(980px, 100%);
    max-width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
    animation: panelIn 0.55s ease both;
}

.brand-panel {
    position: relative;
    min-height: 560px;
    padding: 52px;
    background: linear-gradient(145deg, #0f172a, #273c75 58%, #16a34a);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.brand-panel:before {
    content: "";
    position: absolute;
    inset: 34px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 22px;
    animation: floatLine 5s ease-in-out infinite;
}

.brand-mark {
    width: 104px;
    height: 104px;
    background: white;
    border-radius: 24px;
    padding: 12px;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.22);
    margin-bottom: 28px;
    z-index: 1;
    animation: logoPop 0.7s ease both;
}

.brand-mark img,
.mobile-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-panel h1 {
    margin: 0;
    font-size: 44px;
    letter-spacing: 0;
    z-index: 1;
}

.brand-panel p {
    max-width: 430px;
    color: #dbeafe;
    line-height: 1.7;
    z-index: 1;
}

.pulse-card {
    margin-top: 26px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 5px 12px;
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 16px;
    z-index: 1;
}

.pulse-card span {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.65);
    animation: pulse 1.6s infinite;
    grid-row: span 2;
}

.pulse-card small {
    color: #dbeafe;
}

.login-card {
    padding: 58px 48px;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.mobile-logo {
    display: none;
    width: 78px;
    height: 78px;
    background: #fff;
    border-radius: 18px;
    padding: 9px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    margin-bottom: 18px;
}

.login-card h2 {
    margin: 0;
    font-size: 32px;
}

.subtitle {
    color: #667085;
    margin: 9px 0 28px;
}

.login-alert {
    position: relative;
    overflow: hidden;
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 14px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    border-left: 5px solid #dc2626;
    animation: shakeIn 0.28s ease both;
}

.login-alert.success {
    background: #dcfce7;
    color: #166534;
    border-left-color: #16a34a;
}

.login-alert:before {
    content: "";
    position: absolute;
    inset: 0;
    width: 45%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.72),
        transparent
    );
    animation: alertShine 1.15s ease 0.12s both;
}

.login-alert:after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: #dc2626;
    transform-origin: left;
    animation: alertTimer 4.8s linear forwards;
}

.login-alert.success:after {
    background: #16a34a;
}

.login-alert.is-hiding {
    animation: alertOut 0.22s ease forwards;
}

form {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

input {
    height: 46px;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    padding: 0 14px;
    font-size: 15px;
    max-width: 100%;
    min-width: 0;
    width: 100%;
    transition: 0.2s;
}

input:focus {
    outline: none;
    border-color: #273c75;
    box-shadow: 0 0 0 4px rgba(39, 60, 117, 0.14);
}

input:user-invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

button {
    height: 48px;
    border: 0;
    border-radius: 12px;
    background: #273c75;
    color: white;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    max-width: 100%;
    min-width: 0;
    width: 100%;
    transition: 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(39, 60, 117, 0.22);
}

.login-help {
    display: grid;
    gap: 8px;
    justify-items: center;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #eef2f7;
    text-align: center;
}

.login-help a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    background: #ecfdf3;
    color: #166534;
    text-decoration: none;
    font-weight: 800;
    transition: 0.2s;
}

.login-help a:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(22, 101, 52, 0.14);
}

.login-help small {
    color: #667085;
    line-height: 1.45;
}

.login-swal {
    border-radius: 20px;
    padding: 24px 22px 26px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
    animation: swalLift 0.32s ease both;
}

.login-swal .swal2-title {
    color: #172033;
    font-size: 24px;
}

.login-swal .swal2-html-container {
    color: #667085;
    line-height: 1.55;
}

.login-swal .swal2-icon {
    margin-top: 10px;
}

.login-swal-button {
    min-width: 120px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: #273c75;
    color: white;
    font-weight: 800;
    padding: 0 20px;
    cursor: pointer;
    transition: 0.2s;
}

.login-swal-button:hover {
    background: #1d2f63;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(39, 60, 117, 0.24);
}

@keyframes panelIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes logoPop {
    from {
        opacity: 0;
        transform: scale(0.84) rotate(-4deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}
@keyframes pulse {
    70% {
        box-shadow: 0 0 0 12px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}
@keyframes floatLine {
    50% {
        transform: translateY(-8px);
    }
}
@keyframes shakeIn {
    0% {
        opacity: 0;
        transform: translateX(10px);
    }
    70% {
        transform: translateX(-2px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}
@keyframes alertOut {
    to {
        opacity: 0;
        transform: translateX(24px) scale(0.96);
    }
}
@keyframes alertTimer {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}
@keyframes alertShine {
    from {
        transform: translateX(-120%);
    }
    to {
        transform: translateX(220%);
    }
}
@keyframes swalLift {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 820px) {
    body {
        padding: 16px;
    }
    .login-shell {
        grid-template-columns: 1fr;
    }
    .brand-panel {
        display: none;
    }
    .login-card {
        padding: 34px 24px;
    }
    .mobile-logo {
        display: block;
    }
}

@media (max-width: 420px) {
    body {
        align-items: start;
        padding: 12px;
    }

    .login-card {
        padding: 26px 18px;
    }

    .login-card h2 {
        font-size: 28px;
    }

    .subtitle,
    .login-help small {
        overflow-wrap: anywhere;
    }
}
