/* =============================================================================
   LOGIN PAGE — premium split-screen
   ============================================================================= */

.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    background: var(--bg);
}

/* --- Brand panel ----------------------------------------------------------- */
.login-brand {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(560px 380px at 85% -60px, rgba(255, 255, 255, .16), transparent 60%),
        radial-gradient(480px 420px at -60px 108%, rgba(18, 143, 166, .55), transparent 62%),
        linear-gradient(155deg, var(--brand-700) 0%, var(--brand-600) 42%, var(--brand-500) 72%, var(--cyan-500) 115%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem 3.25rem;
}

/* Soft dot texture over the gradient. */
.login-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .22) 1.2px, transparent 1.2px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(420px 300px at 78% 12%, #000 0%, transparent 70%),
        radial-gradient(360px 300px at 8% 96%, #000 0%, transparent 70%);
    mask-image: radial-gradient(420px 300px at 78% 12%, #000 0%, transparent 70%),
        radial-gradient(360px 300px at 8% 96%, #000 0%, transparent 70%);
    pointer-events: none;
}

/* Floating glass orbs. */
.login-brand::after {
    content: '';
    position: absolute;
    width: 460px;
    height: 460px;
    top: -170px;
    right: -140px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, .22), rgba(255, 255, 255, .04) 65%);
    border: 1px solid rgba(255, 255, 255, .16);
    animation: orb-drift 14s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes orb-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(-34px, 40px, 0) scale(1.06); }
}

.login-brand-inner { position: relative; z-index: 1; max-width: 470px; }

.login-brand-logo {
    width: 64px;
    height: 64px;
    border-radius: 19px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .34);
    box-shadow: 0 10px 28px rgba(10, 35, 80, .28), inset 0 1px 0 rgba(255, 255, 255, .35);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.7rem;
    overflow: hidden;
    color: #fff;
    animation: rise .55s cubic-bezier(.2, .7, .3, 1) both;
}

.login-brand-logo img { width: 100%; height: 100%; object-fit: cover; }

.login-brand h1 {
    color: #fff;
    font-size: 2.05rem;
    line-height: 1.28;
    letter-spacing: -.02em;
    margin-bottom: .7rem;
    text-wrap: balance;
    animation: rise .55s .06s cubic-bezier(.2, .7, .3, 1) both;
}

.login-brand p {
    color: rgba(255, 255, 255, .88);
    font-size: 1rem;
    line-height: 1.75;
    margin: 0;
    animation: rise .55s .12s cubic-bezier(.2, .7, .3, 1) both;
}

.login-features {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
    margin-top: 2.4rem;
    max-width: 480px;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .72rem .85rem;
    border-radius: 13px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
    backdrop-filter: blur(6px);
    font-size: .86rem;
    font-weight: 500;
    color: rgba(255, 255, 255, .96);
    animation: rise .55s cubic-bezier(.2, .7, .3, 1) both;
}

.login-feature:nth-child(1) { animation-delay: .16s; }
.login-feature:nth-child(2) { animation-delay: .22s; }
.login-feature:nth-child(3) { animation-delay: .28s; }
.login-feature:nth-child(4) { animation-delay: .34s; }

.login-feature svg { flex-shrink: 0; opacity: .95; }

.login-brand-footer {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .55rem;
    font-size: .8rem;
    color: rgba(255, 255, 255, .78);
}

.powered-by {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: rgba(255, 255, 255, .88);
    font-size: .8rem;
    text-decoration: none;
}

.powered-by:hover { color: #fff; text-decoration: none; }

.powered-by img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    display: block;
}

.powered-by strong { font-weight: 700; letter-spacing: .01em; }

/* --- Form panel ------------------------------------------------------------ */
.login-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    background:
        radial-gradient(520px 340px at 50% -80px, var(--brand-50), transparent 65%),
        var(--bg);
}

.login-card {
    width: 100%;
    max-width: 410px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.1rem 2.1rem 1.7rem;
    animation: rise .5s .1s cubic-bezier(.2, .7, .3, 1) both;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

.login-card-head { margin-bottom: 1.5rem; }

.login-card-head h2 {
    font-size: 1.5rem;
    letter-spacing: -.01em;
    margin-bottom: .3rem;
}

.login-card-head p {
    color: var(--muted);
    font-size: .9rem;
    margin: 0;
}

.login-logo-mobile {
    display: none;
    width: 54px;
    height: 54px;
    border-radius: 15px;
    background: linear-gradient(150deg, var(--brand-600), var(--brand-500));
    color: #fff;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.1rem;
    box-shadow: 0 8px 20px rgba(43, 111, 214, .35);
}

.login-form .form-group { margin-bottom: 1rem; }

.login-form .form-control {
    padding: .72rem .95rem;
    min-height: 3rem;
    font-size: .95rem;
    border-radius: 12px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.login-form .form-control:focus {
    border-color: var(--brand-400);
    box-shadow: 0 0 0 4px var(--brand-50);
}

.login-form .form-label { font-size: .86rem; }

.input-group .input-group-text {
    border-radius: 12px 0 0 12px;
}

.input-group .form-control {
    border-radius: 0 12px 12px 0;
}

.password-field { position: relative; }

.password-field .form-control { padding-right: 2.9rem; }

.password-toggle {
    position: absolute;
    right: .35rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    padding: .45rem;
    border-radius: 8px;
    line-height: 0;
}
.password-toggle:hover { color: var(--brand-600); background: var(--brand-50); }

.login-submit {
    width: 100%;
    padding: .8rem;
    min-height: 3rem;
    font-size: .98rem;
    font-weight: 700;
    margin-top: .5rem;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(150deg, var(--brand-600), var(--brand-500));
    box-shadow: 0 10px 24px rgba(43, 111, 214, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
    transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}

.login-submit:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(43, 111, 214, .4), inset 0 1px 0 rgba(255, 255, 255, .25);
}

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

.login-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}

.login-footer {
    margin-top: 1.6rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: .8rem;
    color: var(--muted-light);
}

.login-lang {
    display: flex;
    justify-content: center;
    gap: .5rem;
    margin-bottom: 0;
    margin-top: 1.25rem;
    padding: .35rem;
    background: var(--surface-tint);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.login-lang .btn {
    flex: 1 1 0;
    border-radius: 999px;
    border-color: transparent;
    background: transparent;
    color: var(--green-500);
    font-weight: 700;
}

.login-lang .btn:hover {
    background: var(--green-50);
    color: var(--green-500);
    border-color: transparent;
}

.login-lang .btn-primary {
    background: linear-gradient(150deg, #15803D, var(--green-500));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 16px rgba(22, 163, 74, .35), var(--shadow-sm);
}

.login-lang .btn-primary:hover {
    background: linear-gradient(150deg, #15803D, var(--green-500));
    color: #fff;
    filter: brightness(1.06);
}

/* --- Mobile: hero + overlapping card --------------------------------------- */
@media (max-width: 992px) {
    .login-page { grid-template-columns: 1fr; }

    /* Gradient hero with rounded bottom sheet edge. */
    .login-brand {
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        padding: 2.75rem 1.5rem 3.4rem;
        border-radius: 0 0 28px 28px;
        box-shadow: 0 12px 30px rgba(27, 77, 156, .28);
    }

    .login-brand::before { display: none; }

    .login-brand::after { width: 300px; height: 300px; top: -150px; right: -90px; }

    .login-brand-inner {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        max-width: none;
    }

    .login-brand-logo {
        width: 68px;
        height: 68px;
        border-radius: 20px;
        margin-bottom: .9rem;
        flex-shrink: 0;
    }

    .login-brand h1 {
        font-size: 1.32rem;
        line-height: 1.35;
        margin-bottom: .45rem;
        animation: none;
        text-wrap: balance;
    }

    /* Tagline visible again — two lines max. */
    .login-brand p {
        display: -webkit-box;
        font-size: .88rem;
        line-height: 1.6;
        max-width: 320px;
        margin: 0 auto;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .login-features { display: none; }

    /* Credit centred under the tagline; app info line stays hidden. */
    .login-brand-footer { display: flex; align-items: center; margin-top: .9rem; }
    .login-brand-footer > span:first-child { display: none; }
    .powered-by { font-size: .78rem; }

    .login-logo-mobile { display: none; }

    /* Card pulls up over the hero's rounded edge. */
    .login-form-side {
        padding: 0 1rem 2.5rem;
        min-height: 0;
        align-items: stretch;
        background: var(--bg);
    }

    .login-card {
        max-width: none;
        position: relative;
        z-index: 2;
        margin-top: -26px;
        border-radius: 20px;
        padding: 1.6rem 1.4rem 1.4rem;
        animation: none;
        box-shadow: var(--shadow-lg);
    }

    .login-card-head h2 { font-size: 1.32rem; }

    .login-form .form-control { min-height: 52px; font-size: 1rem; }

    .login-submit { min-height: 52px; }

    .login-lang { margin-top: 1.4rem; }
}

@media (max-width: 400px) {
    .login-form-side { padding: 0 .9rem 2rem; }
    .login-card { padding: 1.6rem 1.25rem 1.35rem; }
    .login-card-head h2 { font-size: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
    .login-brand::after,
    .login-brand-logo,
    .login-brand h1,
    .login-brand p,
    .login-feature,
    .login-card { animation: none; }
    .login-submit:hover { transform: none; }
}
