:root {
    --primary: #4361EE;
    --primary-hover: #3751dc;
    --primary-dim: rgba(67, 97, 238, 0.12);
    --primary-glow: rgba(67, 97, 238, 0.28);
    --danger: #ef4444;
    --danger-dim: rgba(239, 68, 68, 0.08);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --bg-card: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body.login-body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body.login-body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #e0eaff 0%, #f4f7fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 16px;
}

/* Ambient floating backdrop blur container & blobs */
.ambient-container {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.ambient-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.55;
    pointer-events: none;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 40vw;
    height: 40vw;
    background: #93c5fd;
    animation: floatBlob1 16s infinite ease-in-out alternate;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 45vw;
    height: 45vw;
    background: #c7d2fe;
    animation: floatBlob2 18s infinite ease-in-out alternate;
}

@keyframes floatBlob1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(6%, 8%) scale(1.08); }
}

@keyframes floatBlob2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-6%, -8%) scale(1.06); }
}

/* Login Card */
.login-card {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 34px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.03);
    margin: auto;
}

.login-header {
    text-align: center;
    margin-bottom: 22px;
}

.login-logo {
    height: 68px;
    max-width: 100%;
    object-fit: contain;
    margin-bottom: 8px;
    transition: transform 0.3s ease;
}

.login-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
    margin-bottom: 2px;
}

.login-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.form-control {
    height: 44px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    padding: 0 14px;
    font-size: 0.9rem;
    color: var(--text-main);
    background-color: #f8fafc;
    transition: all 0.2s ease;
}

.form-control:focus {
    background-color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-dim);
    outline: none;
}

.input-group-password {
    position: relative;
}

.input-group-password .form-control {
    padding-right: 44px;
}

.password-toggle-btn {
    position: absolute;
    right: 0;
    top: 0;
    height: 44px;
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 5;
    transition: color 0.15s ease;
}

.password-toggle-btn:hover {
    color: var(--text-main);
}

.form-check-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.form-check-input {
    cursor: pointer;
    border-radius: 6px;
    border: 1.5px solid var(--border);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-submit {
    height: 44px;
    background: var(--primary);
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.925rem;
    color: #ffffff;
    box-shadow: 0 6px 18px var(--primary-dim);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}

.btn-submit:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: 0 8px 22px var(--primary-glow);
    transform: translateY(-1px);
    color: #ffffff;
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

.alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    color: #991b1b;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.835rem;
    font-weight: 500;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.06);
    animation: alertSlideDown 0.25s ease-out;
}

@keyframes alertSlideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-error-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    flex-shrink: 0;
}

.alert-error-text {
    flex: 1;
    line-height: 1.35;
}

.alert-error ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.alert-error li {
    margin: 0;
    padding: 0;
}

.form-control.input-validation-error {
    border-color: #ef4444 !important;
    background-color: #fffaf0;
}

.form-control.input-validation-error:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15) !important;
}

.field-validation-error,
.text-danger {
    color: #dc2626 !important;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 5px;
    display: block;
    line-height: 1.3;
}

.field-group {
    margin-bottom: 16px;
}

.footer-note {
    text-align: center;
    margin-top: 20px;
    font-size: 0.775rem;
    color: var(--text-muted);
}

/* Fallback for very small height screens (mobile landscape) */
@media (max-height: 560px) {
    html, body.login-body {
        overflow-y: auto;
        height: auto;
        min-height: 100%;
    }
}
