/* ==========================================================================
   School Insight ERP — Login Page
   Full viewport cover with 50px margin, no overflow
   ========================================================================== */

html:has(.login-body),
.login-body {
    height: 100%;
}

.login-body {
    margin: 0;
    padding: 0;
    background: #F3F6FB;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
}

.login-page {
    box-sizing: border-box;
    width: calc(100% - 100px);
    height: calc(100vh - 100px);
    height: calc(100dvh - 100px);
    max-width: calc(100vw - 100px);
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
    margin: 50px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: transparent;
    border: 0;
    box-shadow: none;
    border-radius: 0;
}

.login-shell {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: stretch;
    padding: 1.25rem 1.5rem 0.75rem;
    overflow: hidden;
}

.login-row {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    background: transparent;
    height: 100%;
    align-items: center;
}

.login-row > [class*="col-"] {
    height: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

/* --------------------------------------------------------------------------
   Left Panel
   -------------------------------------------------------------------------- */

.login-brand-panel {
    padding: 0.25rem 2rem 0.75rem 0;
    display: flex;
    align-items: center;
}

.login-brand-inner {
    max-width: 520px;
    width: 100%;
}

.login-logo-link.brand-3d {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.1rem;
    padding: 0.65rem 0.9rem;
    overflow: visible;
    line-height: 0;
}

.login-logo {
    height: auto;
    width: auto;
    max-height: 72px;
    max-width: min(340px, 85vw);
    object-fit: contain;
    object-position: center;
    position: relative;
    z-index: 1;
    border-radius: 10px;
    filter: drop-shadow(0 10px 20px rgba(79, 142, 247, 0.35));
}

.login-brand-title {
    font-family: var(--font-heading);
    font-size: clamp(1.55rem, 2.6vw, 2.1rem);
    font-weight: 800;
    color: var(--heading);
    line-height: 1.2;
    margin-bottom: 0.7rem;
}

.login-brand-title span {
    color: var(--primary);
}

.login-brand-text {
    font-size: 0.92rem;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 1.1rem;
    max-width: 460px;
}

.login-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.7rem;
    margin-bottom: 1.1rem;
    max-width: 420px;
}

.login-feature-tile {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.login-feature-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.login-feature-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.login-feature-tile span {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--heading);
    line-height: 1.3;
}

/* Illustration */
.login-illustration {
    position: relative;
    height: 160px;
    margin-top: 0.25rem;
    max-width: 100%;
}

.illus-scene {
    position: relative;
    width: 100%;
    height: 100%;
}

.illus-school {
    position: absolute;
    left: 8%;
    bottom: 0;
    width: 140px;
    height: 130px;
}

.illus-tower {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 42px;
    height: 52px;
    background: #4F8EF7;
    border-radius: 8px 8px 0 0;
}

.illus-tower::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
}

.illus-building {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 0;
    height: 88px;
    background: #fff;
    border: 3px solid #4F8EF7;
    border-radius: 10px 10px 0 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 14px 12px 28px;
}

.illus-window {
    background: #BFD7FF;
    border-radius: 4px;
    height: 22px;
}

.illus-door {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 26px;
    height: 32px;
    background: #3A7AE8;
    border-radius: 6px 6px 0 0;
}

.illus-backpack {
    position: absolute;
    left: 42%;
    bottom: 18px;
    width: 44px;
    height: 44px;
    background: #4F8EF7;
    border-radius: 12px;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1rem;
    box-shadow: 0 8px 20px rgba(79,142,247,0.35);
    transform: rotate(-8deg);
}

.illus-books {
    position: absolute;
    left: 28%;
    bottom: 8px;
    display: flex;
    gap: 3px;
    align-items: flex-end;
}

.illus-books span {
    display: block;
    width: 14px;
    border-radius: 2px;
}

.illus-books span:nth-child(1) { height: 28px; background: #7CC6FE; }
.illus-books span:nth-child(2) { height: 36px; background: #4F8EF7; }
.illus-books span:nth-child(3) { height: 24px; background: #64D2FF; }

.illus-float-card {
    position: absolute;
    right: 5%;
    bottom: 30px;
    background: rgba(255,255,255,0.95);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-md);
    min-width: 130px;
}

.illus-float-card small {
    display: block;
    font-size: 0.68rem;
    color: var(--text);
}

.illus-float-card strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--heading);
    margin-bottom: 0.4rem;
}

.illus-mini-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 28px;
}

.illus-mini-chart span {
    flex: 1;
    background: linear-gradient(180deg, #4F8EF7, #7CC6FE);
    border-radius: 2px 2px 0 0;
}

.illus-mini-chart span:nth-child(1) { height: 40%; }
.illus-mini-chart span:nth-child(2) { height: 70%; }
.illus-mini-chart span:nth-child(3) { height: 55%; }
.illus-mini-chart span:nth-child(4) { height: 90%; }

/* --------------------------------------------------------------------------
   Right Panel — Login Card
   -------------------------------------------------------------------------- */

.login-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0 0.75rem 1rem;
    position: relative;
    z-index: 5;
}

.login-card {
    width: 100%;
    max-width: 460px;
    max-height: 100%;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 1.75rem 1.75rem 1.5rem;
    box-shadow: 0 20px 60px rgba(23, 43, 77, 0.1);
    position: relative;
    z-index: 6;
    pointer-events: auto;
    transform: none !important;
    overflow: auto;
}

.login-card * {
    pointer-events: auto;
}

.login-card .input-icon-left {
    pointer-events: none !important;
}

.login-card-head h2 {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--heading);
    margin-bottom: 0.35rem;
}

.login-card-head p {
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 1.5rem;
}

/* Tabs */
.login-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}

.login-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 0.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    transition: all var(--transition);
    color: #8A94A6;
    margin-bottom: -1px;
}

.login-tab i {
    font-size: 1rem;
}

.login-tab span {
    font-family: var(--font-heading);
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
}

.login-tab:hover {
    color: var(--primary);
}

.login-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.login-tab.active i {
    color: var(--primary);
}

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

.input-icon-wrap {
    position: relative;
}

.input-icon-left {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9AA6B8;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 2;
}

.login-input {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.8rem 1rem 0.8rem 2.75rem;
    font-size: 0.92rem;
    color: var(--heading);
    background: #FAFBFD;
    transition: all var(--transition);
}

.login-input:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.12);
}

.login-input::placeholder {
    color: #A0AABB;
}

.password-toggle {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9AA6B8;
    padding: 0.25rem;
    cursor: pointer;
    z-index: 2;
    line-height: 1;
}

.password-toggle:hover {
    color: var(--primary);
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.login-options .form-check-label {
    font-size: 0.88rem;
    color: var(--text);
}

.login-options .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.forgot-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary);
}

.forgot-link:hover {
    color: var(--primary-dark);
}

.btn-login-submit {
    position: relative;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    cursor: pointer;
    pointer-events: auto !important;
    user-select: none;
}

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

/* Divider */
.login-divider {
    position: relative;
    text-align: center;
    margin-bottom: 1.1rem;
}

.login-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--border);
}

.login-divider span {
    position: relative;
    background: var(--white);
    padding: 0 0.85rem;
    font-size: 0.82rem;
    color: #9AA6B8;
}

/* Social */
.social-login-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.7rem 0.75rem;
    background: var(--white);
    color: var(--heading);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.88rem;
    transition: all var(--transition);
}

.btn-social:hover {
    border-color: #C5D5F0;
    background: #F8FAFC;
    color: var(--heading);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.login-register-text {
    text-align: center;
    font-size: 0.88rem;
    color: var(--text);
    margin: 0;
}

.login-register-text a {
    font-weight: 600;
    color: var(--primary);
}

.login-form-feedback {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-size: 0.88rem;
    text-align: center;
}

.login-form-feedback.error {
    background: #FEECEC;
    color: #D32F2F;
    border: 1px solid #F7C7C7;
}

.login-form-feedback.success {
    background: #EAF9EF;
    color: #1F8A45;
    border: 1px solid #C8EED5;
}

/* Page Footer */
.login-page-footer {
    flex: 0 0 auto;
    text-align: center;
    padding: 0.7rem 1rem;
    border-top: 1px solid var(--border);
    background: transparent;
}

.login-page-footer p {
    margin: 0;
    font-size: 0.82rem;
    color: #8A94A6;
}

.login-footer-contact {
    margin-top: 0.35rem !important;
    font-size: 0.78rem !important;
}
