/* ============================================================
   LOGIN PAGE — SmartPack 2026
   Full-screen split layout. Left: brand. Right: form.
============================================================ */

/* Force blank-layout to be a transparent full-screen pass-through for login */
.blank-layout:has(.login-root) {
    display: block;
    padding: 0;
    background: transparent;
    min-height: unset;
    place-items: unset;
}

.login-root {
    display: flex;
    height: 100vh;
    width: 100vw;
    background: #edf0f7;
    font-family: var(--font-family, 'Inter', sans-serif);
    overflow: hidden;
}

/* ============================================================
   LEFT PANEL — Brand
============================================================ */

.login-left {
    width: 480px;
    flex-shrink: 0;
    height: 100vh;
    background: linear-gradient(160deg, #2e86e8 0%, #1a6fd4 50%, #1450a8 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
}

/* Subtle background pattern */
.login-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.05) 0%, transparent 50%);
    pointer-events: none;
}

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

.login-left-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 48px;
}

.login-left-logo {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.login-left-logo img {
    width: 34px;
    height: 34px;
    filter: brightness(0) invert(1);
    object-fit: contain;
}

.login-left-title {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px;
    letter-spacing: -0.03em;
}

.login-left-sub {
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    margin: 0;
    line-height: 1.4;
}

.login-left-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.85);
    font-size: 14px;
}

.login-feature i {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.12);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.login-left-footer {
    position: relative;
    z-index: 1;
    font-size: 12px;
    color: rgba(255,255,255,0.35);
}

/* ============================================================
   RIGHT PANEL — Form
============================================================ */

.login-right {
    flex: 1;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    overflow-y: auto;
    background: #edf0f7;
}

.login-right > .login-card {
    margin: 0 auto;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.04),
        0 8px 32px rgba(37,99,235,0.08),
        0 0 0 1px rgba(37,99,235,0.06);
}

.login-card-header {
    margin-bottom: 28px;
}

.login-card-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #0f1623;
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}

.login-card-header p {
    font-size: 13.5px;
    color: #5d6f8a;
    margin: 0;
}

/* Alerts */
.login-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 20px;
    cursor: pointer;
}

.login-alert-success {
    background: rgba(5,150,105,0.08);
    color: #047857;
    border: 1px solid rgba(5,150,105,0.2);
}

.login-alert-error {
    background: rgba(220,38,38,0.07);
    color: #b91c1c;
    border: 1px solid rgba(220,38,38,0.18);
}

/* Microsoft SSO */
.login-sso-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    background: #fff;
    border: 1px solid #cdd8ed;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #0f1623;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    cursor: pointer;
    font-family: inherit;
}

.login-sso-btn:hover {
    background: #f4f7fc;
    border-color: #b8c6df;
    box-shadow: 0 2px 8px rgba(37,99,235,0.08);
    color: #0f1623;
    text-decoration: none;
}

/* Divider */
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: #8a9ab5;
    font-size: 12px;
}

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

/* Fields */
.login-field {
    margin-bottom: 16px;
}

.login-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #3d4f6b;
    margin-bottom: 6px;
}

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

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

.login-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f4f7fc;
    border: 1px solid #cdd8ed;
    border-radius: 10px;
    padding: 0 14px;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.login-input-wrap:focus-within {
    border-color: #3fbbfe;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(63,187,254,0.12);
}

.login-input-wrap.error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220,38,38,0.08);
}

.login-input-wrap > i {
    font-size: 13px;
    color: #8a9ab5;
    flex-shrink: 0;
}

.login-input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: #0f1623;
    padding: 11px 0;
    font-family: inherit;
}

.login-input-wrap input::placeholder { color: #8a9ab5; }
.login-input-wrap input:disabled { opacity: 0.6; }

.login-pw-toggle {
    background: none;
    border: none;
    color: #8a9ab5;
    cursor: pointer;
    padding: 0;
    font-size: 13px;
    flex-shrink: 0;
    transition: color 0.1s;
}
.login-pw-toggle:hover { color: #3d4f6b; }

.login-field-error {
    display: block;
    font-size: 12px;
    color: #dc2626;
    margin-top: 5px;
}

/* Options row */
.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: #5d6f8a;
    cursor: pointer;
    user-select: none;
}

.login-remember input[type=checkbox] {
    width: 15px;
    height: 15px;
    accent-color: #3fbbfe;
    cursor: pointer;
}

/* Submit button */
.login-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #3fbbfe 0%, #2563eb 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s, box-shadow 0.15s, transform 0.1s;
    box-shadow: 0 2px 12px rgba(37,99,235,0.3);
    letter-spacing: 0.01em;
}

.login-submit:hover:not(:disabled) {
    box-shadow: 0 4px 20px rgba(37,99,235,0.4);
    transform: translateY(-1px);
}

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

.login-submit:disabled,
.login-submit.loading {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.login-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: login-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes login-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   RESPONSIVE — hide left panel on small screens
============================================================ */

@media (max-width: 768px) {
    .login-left { display: none; }
    .login-root { background: #fff; }
    .login-card {
        box-shadow: none;
        padding: 32px 24px;
    }
}
