/* ── Reset & Base ── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(160deg, #e8ecf1 0%, #dfe4eb 30%, #eaeef3 60%, #e2e7ee 100%);
    background-color: #e8ecf1;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: url("../images/login-bg.svg") no-repeat center center;
    background-size: cover;
    pointer-events: none;
    z-index: 0;
}

@media (max-width: 767px) {
    body {
        align-items: stretch;
    }
}

/* ── Card Container ── */
.login-card {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: transparent;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

@media (max-width: 767px) {
    .login-card {
        background: #f0f3f7;
    }
}

@media (min-width: 768px) {
    .login-card {
        width: 920px;
        max-width: 95%;
        min-height: 560px;
        height: auto;
        flex-direction: row;
        border-radius: 20px;
        background: #fff;
        box-shadow:
            0 20px 60px rgba(0, 0, 0, 0.12),
            0 1px 3px rgba(0, 0, 0, 0.05);
    }
}

@media (min-width: 1200px) {
    .login-card {
        width: 1020px;
        min-height: 600px;
    }
}

/* ── Left Panel: Branded ── */
.login-brand-panel {
    display: none;
}

@media (min-width: 768px) {
    .login-brand-panel {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 45%;
        padding: 48px 40px 36px;
        background: url("../images/login.jpeg") center / cover no-repeat;
        position: relative;
        overflow: hidden;
        flex-shrink: 0;
    }
}

@media (min-width: 1200px) {
    .login-brand-panel {
        padding: 52px 48px 40px;
    }
}


.brand-content {
    position: relative;
    z-index: 1;
}

.brand-heading {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    margin: 0 0 12px;
    letter-spacing: -0.3px;
}

.brand-subtext {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.6;
    margin: 0 0 32px;
}

/* Feature tags */
.brand-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.brand-feature-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
}

.brand-feature-tag i {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

/* Brand footer */
.brand-footer {
    position: relative;
    z-index: 1;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-footer p {
    margin: 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.5;
}

/* ── Mobile Header ── */
.login-mobile-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 20px 16px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.login-mobile-header img {
    height: 36px;
    width: auto;
}

@media (min-width: 768px) {
    .login-mobile-header {
        display: none;
    }
}

/* ── Right Panel: Form ── */
.login-form-panel {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px 16px 20px;
    overflow-y: auto;
}

@media (max-width: 767px) {
    .login-form-panel {
        background: transparent;
        padding: 20px 16px 24px;
    }

    .login-form-inner {
        background: #fff;
        border-radius: 16px;
        padding: 28px 24px;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    }
}

@media (min-width: 768px) {
    .login-form-panel {
        width: 55%;
        padding: 48px 52px;
    }
}

@media (min-width: 1200px) {
    .login-form-panel {
        padding: 52px 60px;
    }
}

.login-form-inner {
    max-width: 380px;
    margin: 0 auto;
    width: 100%;
}

/* ── Logo (right panel — hidden on mobile since mobile header has it) ── */
.login-logo {
    margin-bottom: 28px;
    display: none;
}

@media (min-width: 768px) {
    .login-logo {
        display: block;
    }
}

.login-logo img {
    height: 44px;
    width: auto;
}

/* ── Heading ── */
.login-heading {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 6px;
    letter-spacing: -0.3px;
}

@media (min-width: 768px) {
    .login-heading {
        font-size: 26px;
    }
}

.login-subtitle {
    color: #6b7280;
    font-size: 14px;
    margin: 0 0 28px;
    line-height: 1.5;
    font-weight: 400;
}

@media (min-width: 768px) {
    .login-subtitle {
        font-size: 15px;
        margin: 0 0 32px;
    }
}

/* ── Form Groups ── */
.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .control-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.login-form .control-label .required {
    color: #ef4444;
    margin-left: 2px;
}

.login-form .label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.login-form .label-row .control-label {
    margin-bottom: 0;
}

.login-form .forgot-link {
    font-size: 13px;
    font-weight: 600;
    color: #2854a0;
    text-decoration: none;
}

.login-form .forgot-link:hover {
    color: #1e3f7a;
    text-decoration: underline;
}

/* ── Input with Icon ── */
.input-icon-wrap {
    position: relative;
}

.input-icon-wrap .input-icon {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    pointer-events: none;
    transition: color 0.2s;
}

.input-icon-wrap .form-control {
    width: 100%;
    height: 46px;
    padding: 0 16px 0 44px;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    color: #111827;
    box-shadow: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
}

.input-icon-wrap .form-control:focus {
    border-color: #2854a0;
    box-shadow: 0 0 0 3px rgba(40, 84, 160, 0.08);
    background: #fff;
}

.input-icon-wrap .form-control:focus ~ .input-icon,
.input-icon-wrap .form-control:focus + .input-icon {
    color: #2854a0;
}

/* Reverse order fix: icon is before input in HTML */
.input-icon-wrap:focus-within .input-icon {
    color: #2854a0;
}

.input-icon-wrap .form-control::placeholder {
    color: #9ca3af;
}

/* Password toggle button */
.input-icon-wrap .password-toggle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.input-icon-wrap .password-toggle:hover {
    color: #4b5563;
}

.input-icon-wrap .form-control.has-toggle {
    padding-right: 44px;
}

/* ── Organization Select ── */
.login-form select.form-control {
    height: 46px;
    padding: 0 16px;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    color: #111827;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.login-form select.form-control:focus {
    border-color: #2854a0;
    box-shadow: 0 0 0 3px rgba(40, 84, 160, 0.08);
    background-color: #fff;
}

/* ── Remember Me ── */
.login-remember {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
}

.login-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0 8px 0 0;
    cursor: pointer;
    accent-color: #2854a0;
    border-radius: 4px;
}

.login-remember label {
    font-size: 13px;
    color: #4b5563;
    font-weight: 400;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

/* ── Login Button ── */
.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 46px;
    padding: 0 20px;
    background: linear-gradient(135deg, #2854a0 0%, #1e3f7a 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

.btn-login:hover {
    background: linear-gradient(135deg, #1e3f7a 0%, #17306a 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(40, 84, 160, 0.3);
    color:#fff;
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-login:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(40, 84, 160, 0.2);
}

/* ── Divider ── */
.login-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.login-divider span {
    padding: 0 12px;
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Footer Links ── */
.login-footer {
    margin-top: auto;
    padding-top: 28px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.login-footer a {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.login-footer a:hover {
    color: #2854a0;
    background: rgba(40, 84, 160, 0.05);
}

.login-footer .footer-dot {
    color: #d1d5db;
    font-size: 12px;
    line-height: 28px;
}

/* ── Preloader ── */
#preloader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#preloader-status img {
    width: 80px;
}

/* ── Animations ── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-form-inner {
    animation: fadeInUp 0.5s ease-out;
}

/* ── Utility ── */
.hide {
    display: none !important;
}

.mt-20 {
    margin-top: 20px;
}

.form-label.required::after {
    content: " *";
    color: #ef4444;
}
