﻿
:root {
    --blue: #0874d1;
    --blue-dark: #0758a6;
    --text: #193354;
    --muted: #7185a2;
    --border: #d8e4f3;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 28px;
    overflow-x: hidden;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background: #d9ecff;
}

button,
input {
    font: inherit;
}

/* Animated background */

.background {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    background: radial-gradient(ellipse at 15% 20%, #b7ddff 0, transparent 45%), radial-gradient(ellipse at 85% 75%, #77b9fa 0, transparent 42%), linear-gradient(135deg, #e7f3ff, #a7d3ff 52%, #dceeff);
}

    .background::before,
    .background::after {
        position: absolute;
        content: "";
        width: 125vw;
        height: 125vw;
        min-width: 900px;
        min-height: 900px;
        left: 50%;
        top: 50%;
        border: 1px solid rgba(255, 255, 255, .65);
        border-radius: 43%;
        transform: translate(-50%, -50%) rotate(-25deg);
        animation: float-wave 24s ease-in-out infinite alternate;
    }

    .background::after {
        width: 105vw;
        height: 105vw;
        border-color: rgba(27, 129, 224, .2);
        border-width: 2px;
        transform: translate(-50%, -50%) rotate(28deg);
        animation-duration: 32s;
        animation-direction: alternate-reverse;
    }

.orb {
    position: absolute;
    width: 230px;
    height: 230px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,.35), rgba(38,135,230,.12));
    filter: blur(2px);
    animation: float-orb 12s ease-in-out infinite alternate;
}

.orb-one {
    top: -90px;
    right: 8%;
}

.orb-two {
    width: 170px;
    height: 170px;
    bottom: -45px;
    left: 8%;
    animation-delay: -5s;
}

.particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    box-shadow: 0 0 15px rgba(255,255,255,.6);
    animation: float-particle 9s ease-in-out infinite alternate;
}

    .particle:nth-child(1) {
        top: 18%;
        left: 8%;
    }

    .particle:nth-child(2) {
        top: 33%;
        left: 19%;
        animation-delay: -3s;
    }

    .particle:nth-child(3) {
        top: 20%;
        right: 13%;
        animation-delay: -5s;
    }

    .particle:nth-child(4) {
        top: 68%;
        right: 8%;
        animation-delay: -2s;
    }

    .particle:nth-child(5) {
        bottom: 13%;
        left: 25%;
        animation-delay: -6s;
    }

    .particle:nth-child(6) {
        top: 54%;
        left: 4%;
        animation-delay: -4s;
    }

/* Main split card */

.login-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: min(100%, 1020px);
    height: min(650px, calc(100dvh - 56px));
    min-height: 520px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 22px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 32px 90px rgba(24, 76, 132, .2), 0 5px 20px rgba(24, 76, 132, .08);
    animation: card-appear .65s ease-out both;
}

/* Image section */

    .image-section {
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        min-width: 0;
        min-height: 0;
        padding: clamp(28px, 4vw, 48px);
        overflow: hidden;
        color: #fff;
        background: linear-gradient(180deg, rgba(4, 34, 70, .78), rgba(4, 47, 85, .12) 65%, rgba(3, 34, 63, .7)), url('/images/login-background.png') center / cover no-repeat, #124f83;
    }

    .image-section::after {
        position: absolute;
        inset: 0;
        content: "";
        z-index: 0;
        pointer-events: none;
        background: linear-gradient(140deg, rgba(8, 66, 119, .3), transparent 60%);
    }

.image-content,
.image-bottom {
    position: relative;
    z-index: 1;
}

.image-indicator {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
}

    .image-indicator span {
        width: 26px;
        height: 5px;
        border-radius: 10px;
        background: rgba(255,255,255,.3);
    }

        .image-indicator span:first-child {
            width: 38px;
            background: #49d2f0;
        }

.image-content h1 {
    max-width: 390px;
    margin: 0;
    font-size: clamp(27px, 3vw, 39px);
    font-weight: 600;
    line-height: 1.24;
    letter-spacing: -1.1px;
}

    .image-content h1 span {
        color: #58d9f5;
    }

.image-content p {
    max-width: 355px;
    margin: 19px 0 0;
    color: #e0efff;
    font-size: 14px;
    line-height: 1.8;
}

.image-bottom {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #edf7ff;
    font-size: 12px;
}

.image-bottom-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #5de4a1;
    box-shadow: 0 0 12px rgba(93,228,161,.6);
}

/* Login form */

.form-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    padding: clamp(26px, 4vw, 55px);
    overflow-y: auto;
    background: rgba(255,255,255,.96);
}

.form-content {
    width: 100%;
    max-width: 370px;
    margin: auto;
}

.form-heading {
    margin-bottom: 28px;
}

    .form-heading h2 {
        margin: 0;
        color: #172f51;
        font-size: clamp(27px, 3vw, 32px);
        font-weight: 700;
        letter-spacing: -.8px;
    }

    .form-heading p {
        margin: 9px 0 0;
        color: var(--muted);
        font-size: 14px;
        line-height: 1.6;
    }

.error-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 22px;
    padding: 12px;
    border: 1px solid #ffd4d8;
    border-radius: 9px;
    background: #fff2f3;
    color: #c62838;
    font-size: 12px;
    line-height: 1.6;
}

    .error-message svg {
        flex-shrink: 0;
        width: 17px;
        height: 17px;
        margin-top: 1px;
    }

    .error-message[hidden] {
        display: none;
    }

.field {
    margin-bottom: 20px;
}

    .field label {
        display: block;
        margin-bottom: 9px;
        color: #263c59;
        font-size: 13px;
        font-weight: 600;
    }

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 19px;
    height: 19px;
    transform: translateY(-50%);
    color: #7890b1;
    pointer-events: none;
}

.form-input {
    width: 100%;
    min-height: 49px;
    padding: 12px 44px;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: none;
    background: #fbfdff;
    color: var(--text);
    font-size: 13px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

    .form-input::placeholder {
        color: #9aaac0;
    }

    .form-input:hover {
        border-color: #b9cee7;
    }

    .form-input:focus {
        border-color: var(--blue);
        background: #fff;
        box-shadow: 0 0 0 4px rgba(8,116,209,.1);
    }

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #7187a5;
    cursor: pointer;
}

    .password-toggle:hover {
        background: #edf5ff;
        color: var(--blue);
    }

    .password-toggle svg {
        width: 19px;
        height: 19px;
    }

.options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 0 25px;
}

.remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #647995;
    font-size: 12px;
    cursor: pointer;
}

    .remember input {
        width: 15px;
        height: 15px;
        margin: 0;
        accent-color: var(--blue);
    }

    .text-link {
        color: var(--blue);
        font-size: 12px;
        font-weight: 600;
        text-decoration: none;
    }

    .text-link:hover {
        text-decoration: underline;
    }

    .login-button {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        min-height: 51px;
        padding: 13px 18px;
        border: 0;
        border-radius: 9px;
        background: linear-gradient(110deg, #0877d8, #0864bd);
        color: #fff;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        box-shadow: 0 6px 16px rgba(8,116,209,.18);
        transition: transform .2s, box-shadow .2s, background .2s;
    }

    .login-button:hover:not(:disabled) {
        transform: translateY(-1px);
        background: linear-gradient(110deg, #0766bd, #0754a3);
        box-shadow: 0 9px 20px rgba(8,116,209,.24);
    }

    .login-button:focus-visible,
    .password-toggle:focus-visible,
    .text-link:focus-visible {
        outline: 3px solid rgba(8,116,209,.3);
        outline-offset: 3px;
    }

    .login-button:disabled {
        opacity: .75;
        cursor: wait;
    }

    .login-button svg {
        width: 18px;
        height: 18px;
    }

    .spinner {
        width: 17px;
        height: 17px;
        border: 2px solid rgba(255,255,255,.4);
        border-top-color: #fff;
        border-radius: 50%;
        animation: spin .7s linear infinite;
    }

    .security-note {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        margin-top: 27px;
        color: #8293aa;
        font-size: 11px;
        text-align: center;
    }

    .security-note svg {
        flex-shrink: 0;
        width: 16px;
        height: 16px;
        color: #4b9b75;
    }

/* Animations */

@keyframes float-wave {
    from {
        margin-left: -2%;
        margin-top: -1%;
    }

    to {
        margin-left: 2%;
        margin-top: 1%;
    }
}

@keyframes float-orb {
    from {
        transform: translate3d(0, 0, 0);
    }

    to {
        transform: translate3d(-35px, 30px, 0);
    }
}

@keyframes float-particle {
    from {
        transform: translateY(0);
        opacity: .55;
    }

    to {
        transform: translateY(-25px);
        opacity: 1;
    }
}

@keyframes card-appear {
    from {
        opacity: 0;
        transform: translateY(15px) scale(.99);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Smaller screens */

@media (max-width: 760px) {
    body {
        padding: 18px;
    }

    .login-card {
        grid-template-columns: minmax(0, 1fr);
        width: min(100%, 470px);
        height: auto;
        min-height: 0;
        max-height: calc(100dvh - 36px);
        overflow-y: auto;
        border-radius: 18px;
    }

    .image-section {
        min-height: 170px;
        padding: 23px 25px;
        background-position: center 55%;
    }

    .image-indicator {
        margin-bottom: 15px;
    }

    .image-content h1 {
        max-width: 100%;
        font-size: clamp(23px, 5vw, 29px);
    }

    .image-content p {
        margin-top: 9px;
        font-size: 12px;
        line-height: 1.55;
    }

    .image-bottom {
        margin-top: 20px;
        font-size: 11px;
    }

    .form-section {
        padding: 29px 25px;
        overflow: visible;
    }

    .form-content {
        max-width: 100%;
    }

    .form-heading {
        margin-bottom: 23px;
    }

        .form-heading h2 {
            font-size: 27px;
        }

    .field {
        margin-bottom: 17px;
    }

    .options {
        margin-bottom: 21px;
    }

    .security-note {
        margin-top: 21px;
    }
}

@media (max-width: 380px) {
    body {
        padding: 10px;
    }

    .login-card {
        max-height: calc(100dvh - 20px);
        border-radius: 14px;
    }

    .image-section {
        min-height: 150px;
        padding: 18px;
    }

    .image-content h1 {
        font-size: 22px;
    }

    .image-content p {
        font-size: 11px;
    }

    .form-section {
        padding: 23px 18px;
    }

    .form-heading h2 {
        font-size: 25px;
    }

    .form-heading p {
        font-size: 12px;
    }
}

@media (max-height: 650px) and (min-width: 761px) {
    body {
        padding: 12px;
    }

    .login-card {
        height: calc(100dvh - 24px);
        min-height: 0;
    }

    .image-section {
        padding: 24px 30px;
    }

    .image-indicator {
        margin-bottom: 18px;
    }

    .image-content p {
        margin-top: 12px;
    }

    .form-section {
        padding: 20px 30px;
    }

    .form-heading {
        margin-bottom: 20px;
    }

    .field {
        margin-bottom: 15px;
    }

    .options {
        margin-bottom: 18px;
    }

    .security-note {
        margin-top: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
