/**
 * MMITS login — mobile: centered card (no hero); desktop: split layout + carousel.
 */

/* Hero hidden on mobile; shown from lg up */
.login-page__hero {
    display: none;
}
.login-page {
    --login-accent: #a91111;
    --login-accent-hover: #8e0e0e;
    --login-accent-soft: rgba(169, 17, 17, 0.08);
    --login-text: #111827;
    --login-muted: #6b7280;
    --login-border: #d1d5db;
    --login-input-bg: #ffffff;
    --login-radius: 6px;
    --login-shadow: 0 12px 40px rgba(17, 24, 39, 0.08), 0 2px 8px rgba(17, 24, 39, 0.04);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #ffffff;
    color: var(--login-text);
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
}

body.login-page {
    margin: 0;
    min-height: 100%;
    min-height: 100dvh;
}

.login-page__shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.login-page main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    padding-top: max(1rem, env(safe-area-inset-top));
    min-height: 0;
}

.login-page__layout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
}

.login-page__aside {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
}

.login-page__aside-inner {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
    overflow-y: auto;
}

.login-page__panel {
    width: 100%;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: var(--login-shadow);
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0;
    overflow: hidden;
}

.login-page__panel-accent {
    height: 4px;
    background: linear-gradient(90deg, #7a0c0c, #c41414);
}

.login-page__panel-body {
    padding: 2rem 1.75rem 1.75rem;
}

.login-page__logo {
    max-width: 128px;
    height: auto;
    display: block;
    margin: 0 auto 1.25rem;
}

.login-page__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--login-text);
    text-align: center;
    margin: 0 0 0.35rem;
    letter-spacing: -0.03em;
}

.login-page__subtitle {
    font-size: 0.875rem;
    color: var(--login-muted);
    text-align: center;
    margin: 0 0 1.5rem;
    line-height: 1.45;
}

.login-page__field {
    margin-bottom: 1.15rem;
}

.login-page__label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.4rem;
}

.login-page__input-wrap {
    position: relative;
}

.login-page__input-wrap > i.field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
    transition: color 0.15s ease;
}

.login-page__input-wrap:focus-within > i.field-icon {
    color: var(--login-accent);
}

.login-page .login-page__input {
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 44px 0 42px;
    font-size: 16px !important;
    color: var(--login-text);
    background: var(--login-input-bg);
    border: 1px solid var(--login-border);
    border-radius: var(--login-radius) !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-page .login-page__input::placeholder {
    color: #9ca3af;
}

.login-page .login-page__input:hover {
    border-color: #9ca3af;
}

.login-page .login-page__input:focus {
    outline: none;
    border-color: var(--login-accent);
    box-shadow: 0 0 0 3px rgba(169, 17, 17, 0.14);
}

.login-page .login-page__input.is-invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.login-page__field-error {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #b91c1c;
}

.login-page__toggle-pw {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #6b7280;
    padding: 10px 12px;
    min-width: 44px;
    min-height: 44px;
    cursor: pointer;
    z-index: 2;
    line-height: 1;
    border-radius: 8px;
}

.login-page__toggle-pw:hover {
    color: var(--login-accent);
}

.login-page__toggle-pw:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--login-accent-soft);
}

.login-page__actions {
    margin-top: 0.25rem;
}

.login-page__submit {
    width: 100%;
    height: 48px;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(180deg, #b81212 0%, #a91111 50%, #8e0e0e 100%);
    border: none;
    border-radius: var(--login-radius) !important;
    transition: filter 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
    box-shadow: 0 2px 8px rgba(169, 17, 17, 0.35);
}

.login-page__submit:hover:not(:disabled) {
    filter: brightness(1.05);
    color: #fff;
}

.login-page__submit:active:not(:disabled) {
    transform: scale(0.99);
    box-shadow: 0 1px 4px rgba(169, 17, 17, 0.3);
}

.login-page__submit:disabled {
    opacity: 0.75;
    cursor: wait;
}

.login-page__forgot-row {
    display: flex;
    justify-content: center;
    margin-top: 1.15rem;
    padding-top: 1.15rem;
    border-top: 1px solid #f3f4f6;
}

.login-page__forgot {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--login-accent) !important;
    text-decoration: none;
    padding: 0.35rem 0.5rem;
}

.login-page__forgot:hover {
    color: var(--login-accent-hover) !important;
    text-decoration: underline;
}

.login-page__alert {
    font-size: 0.8125rem;
    padding: 0.65rem 0.85rem;
    margin-bottom: 1.15rem;
    border-radius: var(--login-radius);
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    line-height: 1.45;
}

.login-page__back-row {
    display: flex;
    justify-content: center;
    margin-top: 1.15rem;
    padding-top: 1.15rem;
    border-top: 1px solid #f3f4f6;
}

.login-page__back {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--login-accent) !important;
    text-decoration: none;
    padding: 0.35rem 0.5rem;
}

.login-page__back:hover {
    color: var(--login-accent-hover) !important;
    text-decoration: underline;
}

.login-page__footer {
    flex-shrink: 0;
    width: 100%;
    text-align: center;
    padding: 1rem 0.5rem 0;
    font-size: 0.75rem;
    color: var(--login-muted);
    background: transparent;
}

@media (max-width: 991.98px) {
    .login-page__panel-body {
        padding: 1.5rem 1.25rem 1.25rem;
    }

    .login-page__panel {
        border-radius: 1rem;
    }

    .login-page .login-page__input,
    .login-page__submit {
        height: 52px;
        border-radius: 12px !important;
    }
}

@media (max-height: 720px) and (max-width: 991.98px) {
    .login-page__panel-body {
        padding: 1.15rem 1.15rem 1rem;
    }

    .login-page__logo {
        max-width: 100px;
        margin-bottom: 0.75rem;
    }

    .login-page__field {
        margin-bottom: 0.85rem;
    }
}

/* —— Desktop: original split layout with image carousel —— */
@media (min-width: 992px) {
    html,
    body.login-page {
        height: 100%;
        overflow: hidden;
    }

    .login-page {
        height: 100%;
        overflow: hidden;
        background: #ffffff;
    }

    .login-page__shell {
        height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
    }

    .login-page main {
        align-items: stretch;
        justify-content: flex-start;
        padding: 0;
    }

    .login-page__layout {
        flex: 1;
        flex-direction: row;
        align-items: stretch;
        max-width: none;
        margin: 0;
        min-height: 0;
        height: 100%;
    }

    .login-page__hero {
        display: block;
        position: relative;
        flex: 1.15;
        min-height: 0;
        background: #1a1a1a;
    }

    .login-page__carousel,
    .login-page__carousel .carousel-inner,
    .login-page__carousel .carousel-item,
    .login-page__carousel .carousel-item img {
        height: 100%;
        min-height: 0;
    }

    .login-page__carousel {
        border-radius: 0;
        overflow: hidden;
    }

    .login-page__carousel .carousel-item img {
        object-fit: cover;
        width: 100%;
    }

    .login-page__hero-overlay {
        position: absolute;
        inset: 0;
        background: linear-gradient(105deg, rgba(17, 24, 39, 0.72) 0%, rgba(17, 24, 39, 0.35) 45%, rgba(169, 17, 17, 0.15) 100%);
        pointer-events: none;
        z-index: 1;
    }

    .login-page__carousel .carousel-indicators {
        z-index: 3;
        margin-bottom: 0.75rem;
    }

    .login-page__carousel .carousel-indicators li {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        margin: 0 4px;
        background-color: rgba(255, 255, 255, 0.45);
        border: none;
    }

    .login-page__carousel .carousel-indicators li.active {
        background-color: #fff;
        width: 22px;
        border-radius: 4px;
    }

    .login-page__carousel .carousel-control-prev,
    .login-page__carousel .carousel-control-next {
        z-index: 3;
        width: 12%;
        opacity: 0.85;
    }

    .login-page__aside {
        flex: 0 0 550px;
        max-width: 550px;
        height: 100%;
        padding: 0;
        border-left: 1px solid rgba(0, 0, 0, 0.06);
        box-shadow: -8px 0 32px rgba(17, 24, 39, 0.04);
        background: #ffffff;
        overflow: hidden;
    }

    .login-page__aside-inner {
        padding: 1.25rem 1.5rem;
    }

    .login-page__layout .login-page__aside {
        width: auto;
    }

    .login-page__panel {
        max-width: none;
        border-radius: 12px;
    }

    .login-page__footer {
        max-width: none;
        margin-top: 0;
        padding: 0.85rem 1.5rem 1rem;
        background: #fff;
        border-top: 1px solid #e5e7eb;
    }

    .login-page .login-page__input,
    .login-page__submit {
        height: 48px;
        border-radius: var(--login-radius) !important;
    }
}
