:root {
    --ist-purple-deep: #3a0758;
    --ist-purple: #4F0B7B;
    --ist-purple-mid: #702fa0;
    --ist-pink: #B964BB;
    --ist-orange: #ff7c00;
    --ist-ink: #1a1224;
    --ist-muted: #6b6178;
    --ist-surface: #ffffff;
    --ist-brand-soft: #f8f5fb;
    --ist-field: #f7f4fb;
    --ist-border: #e4dceb;
    --ist-danger: #c62828;
}

.auth-wrapper.ist-login {
    min-height: 100vh;
    min-width: 100%;
    display: flex;
    align-items: stretch;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(ellipse 75% 55% at 12% 15%, rgba(185, 100, 187, 0.24), transparent 52%),
        radial-gradient(ellipse 65% 50% at 88% 88%, rgba(255, 124, 0, 0.1), transparent 58%),
        linear-gradient(
            145deg,
            var(--ist-purple-deep) 0%,
            var(--ist-purple) 28%,
            var(--ist-purple-mid) 52%,
            var(--ist-pink) 82%,
            #9a4f9c 100%
        );
    font-family: inherit;
    color: var(--ist-ink);
}

.auth-wrapper.ist-login a {
    color: var(--ist-purple-mid);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-wrapper.ist-login a:hover {
    color: var(--ist-orange);
}

body.ist-login-page {
    color: var(--ist-ink);
}

body.ist-login-page.dark {
    background: transparent;
}

body.ist-login-page #theme-indicator,
body.ist-login-page #theme-switch,
.auth-wrapper.ist-login ~ #theme-indicator,
.auth-wrapper.ist-login #theme-indicator,
.auth-wrapper.ist-login #theme-switch {
    display: none !important;
}

.ist-login-shell {
    position: relative;
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    width: min(920px, 94vw);
    min-height: min(560px, 88vh);
    margin: auto;
    border-radius: 18px;
    overflow: hidden;
    box-shadow:
        0 2px 12px rgba(26, 4, 40, 0.12),
        0 28px 56px rgba(26, 4, 40, 0.28);
    background: var(--ist-surface);
    animation: istLoginIn 0.5s ease-out both;
}

@keyframes istLoginIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ist-login-brand {
    position: relative;
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background:
        linear-gradient(165deg, #ffffff 0%, var(--ist-brand-soft) 55%, #f3ebf8 100%);
    border-right: 1px solid var(--ist-border);
    overflow: hidden;
}

.ist-login-brand::before {
    content: "";
    position: absolute;
    right: -80px;
    top: -80px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(185, 100, 187, 0.16), transparent 70%);
    pointer-events: none;
}

.ist-login-brand::after {
    content: "";
    position: absolute;
    left: -60px;
    bottom: -90px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 124, 0, 0.12), transparent 70%);
    pointer-events: none;
}

.ist-login-brand-inner {
    position: relative;
    z-index: 1;
    max-width: 320px;
    margin: 0 auto;
    text-align: center;
}

.ist-login-logo {
    display: block;
    width: min(300px, 72vw);
    height: auto;
    max-height: 150px;
    object-fit: contain;
    margin: 0 auto 1.85rem;
    mix-blend-mode: multiply;
}

.ist-login-brand .ist-login-title {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    margin: 0 auto 0.5rem;
    max-width: 100%;
}

.ist-login-title-text {
    font-size: clamp(1.45rem, 2.2vw, 1.85rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--ist-purple);
    white-space: nowrap;
}

.ist-login-title-accent {
    color: var(--ist-purple-mid);
    font-weight: 700;
}

.auth-wrapper.ist-login .ist-login-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 9px;
    color: #fff;
    background: linear-gradient(135deg, var(--ist-pink), var(--ist-orange));
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(185, 100, 187, 0.3);
}

.ist-login-title-icon i,
.ist-login-title-icon .feather {
    font-size: 0.95rem;
    line-height: 1;
    color: #fff !important;
}

.auth-wrapper.ist-login .ist-login-brand .ist-login-brand-org {
    margin: 0 0 0.85rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ist-pink);
}

.ist-login-brand-lead {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--ist-muted);
    margin: 0;
    font-weight: 500;
}

.ist-login-panel {
    padding: 2.75rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--ist-surface);
}

.ist-login-panel-header {
    margin-bottom: 1.6rem;
}

.ist-login-panel-header h2 {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--ist-purple);
    margin: 0 0 0.35rem;
    letter-spacing: -0.02em;
}

.ist-login-panel-header p {
    margin: 0;
    color: var(--ist-muted);
    font-size: 0.92rem;
    font-weight: 500;
}

.ist-login-form {
    width: 100%;
    text-align: left;
}

.ist-login-form .form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ist-purple);
    margin-bottom: 0.4rem;
}

.ist-login-field {
    position: relative;
    margin-bottom: 1rem;
}

.auth-wrapper.ist-login .ist-login-field .form-control {
    height: 2.9rem !important;
    border-radius: 10px;
    border: 1.5px solid var(--ist-border);
    background: var(--ist-field);
    padding: 0.6rem 1rem 0.6rem 2.65rem;
    font-size: 0.95rem;
    color: var(--ist-ink);
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ist-login-field .form-control::placeholder {
    color: #9a91a8;
}

.ist-login-field .form-control:focus {
    border-color: var(--ist-purple-mid);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(112, 47, 160, 0.14);
    outline: none;
}

.ist-login-field-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ist-pink);
    font-size: 1rem;
    pointer-events: none;
}

.ist-login-error {
    color: var(--ist-danger);
    font-size: 0.875rem;
    margin: 0 0 1rem;
    line-height: 1.4;
}

.ist-login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.15rem 0 1.25rem;
    flex-wrap: wrap;
}

.ist-login-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.9rem;
    color: var(--ist-muted);
    cursor: pointer;
    user-select: none;
}

.ist-login-remember input[type="checkbox"] {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--ist-purple-mid);
    cursor: pointer;
}

.ist-login-forgot {
    font-size: 0.875rem !important;
}

.auth-wrapper.ist-login .ist-login-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 2.95rem !important;
    border: none;
    border-radius: 10px;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--ist-purple-mid) 0%, var(--ist-purple) 100%);
    box-shadow: 0 8px 20px rgba(79, 11, 123, 0.25);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.ist-login-submit:hover {
    filter: brightness(1.05);
    box-shadow: 0 10px 24px rgba(79, 11, 123, 0.32);
    transform: translateY(-1px);
    color: #fff;
}

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

@media (max-width: 860px) {
    .ist-login-shell {
        grid-template-columns: 1fr;
        min-height: auto;
        margin: 1.25rem auto;
    }

    .ist-login-brand {
        padding: 1.75rem 1.5rem 1.35rem;
        border-right: none;
        border-bottom: 1px solid var(--ist-border);
        align-items: center;
    }

    .ist-login-brand-inner {
        max-width: none;
    }

    .ist-login-title-text {
        font-size: 1.25rem;
    }

    .auth-wrapper.ist-login .ist-login-title-icon {
        width: 1.95rem;
        height: 1.95rem;
    }

    .ist-login-title-icon i {
        font-size: 0.85rem;
    }

    .ist-login-logo {
        width: min(240px, 68vw);
        max-height: 120px;
        margin-bottom: 1.35rem;
    }

    .ist-login-panel {
        padding: 1.6rem 1.5rem 2rem;
    }
}
