/* ==========================================================================
   FinMate - Finance Management Login Experience (2026 SaaS Edition)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    height: 100%;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #0f172a;
    color: #1e293b;
    overflow-x: hidden;
}

/* Split-screen login layout */
.cm-login-wrapper {
    min-height: 100vh;
    display: flex;
    width: 100%;
}

/* Left Brand Panel */
.cm-brand-panel {
    flex: 1.1;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 45%, #0f172a 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 60px;
    overflow: hidden;
}

/* Dynamic abstract gradient glow spheres */
.cm-brand-panel::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, rgba(37, 99, 235, 0) 70%);
    top: -100px;
    left: -100px;
    border-radius: 50%;
    filter: blur(40px);
}

.cm-brand-panel::after {
    content: '';
    position: absolute;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(147, 51, 234, 0.2) 0%, rgba(147, 51, 234, 0) 70%);
    bottom: -80px;
    right: -80px;
    border-radius: 50%;
    filter: blur(50px);
}

.cm-brand-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 14px;
}

.cm-brand-logo-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 800;
    font-size: 20px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.cm-brand-title {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.cm-brand-title span {
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cm-brand-content {
    position: relative;
    z-index: 2;
    max-width: 520px;
    margin: auto 0;
}

.cm-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: #38bdf8;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 24px;
}

.cm-brand-hero-title {
    font-size: 38px;
    font-weight: 800;
    line-height: 1.2;
    color: #ffffff;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.cm-brand-hero-desc {
    font-size: 15px;
    line-height: 1.6;
    color: #94a3b8;
    margin-bottom: 32px;
}

.cm-feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.cm-feature-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cm-feature-item i {
    color: #38bdf8;
    font-size: 18px;
}

.cm-feature-item span {
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 500;
}

.cm-brand-footer {
    position: relative;
    z-index: 2;
    color: #64748b;
    font-size: 12px;
}

/* Right Form Panel */
.cm-form-panel {
    flex: 0.9;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 48px;
    position: relative;
}

.cm-login-card {
    width: 100%;
    max-width: 420px;
}

.cm-form-header {
    margin-bottom: 32px;
}

.cm-form-header h2 {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.cm-form-header p {
    font-size: 14px;
    color: #64748b;
}

/* Input Fields & Wrappers */
.cm-input-group {
    margin-bottom: 20px;
    position: relative;
}

.cm-input-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.cm-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.cm-input-icon {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    font-size: 15px;
    pointer-events: none;
    transition: color 0.2s ease;
}

.cm-input {
    width: 100%;
    height: 46px;
    padding: 10px 14px 10px 42px;
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cm-input:focus {
    background-color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.cm-input:focus + .cm-input-icon,
.cm-input-wrapper:focus-within .cm-input-icon {
    color: #2563eb;
}

/* Select element styling */
select.cm-input {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 38px;
}

/* Modern Login CTA Button */
.cm-btn-login {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cm-btn-login:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.cm-btn-login:active {
    transform: translateY(0);
}

/* Compatibility classes for legacy markup & scripts */
.limiter { width: 100%; }
.container-login100 { display: none; }
.wrap-input100 { margin-bottom: 20px; }
.input100 { @extend .cm-input; }

/* Responsive behavior - Ultra-Modern Mobile Experience */
@media (max-width: 992px) {
    body, html {
        background: #0b1120;
    }

    .cm-login-wrapper {
        flex-direction: column;
        min-height: 100vh;
        background: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #0f172a 50%, #0b1120 100%);
        padding: 0;
        justify-content: flex-start;
    }
    
    .cm-brand-panel {
        padding: 32px 24px 16px 24px;
        flex: none;
        background: transparent;
        text-align: center;
        align-items: center;
    }

    .cm-brand-panel::before {
        display: block;
        width: 250px;
        height: 250px;
        top: -60px;
        left: 50%;
        transform: translateX(-50%);
        background: radial-gradient(circle, rgba(56, 189, 248, 0.2) 0%, rgba(37, 99, 235, 0) 70%);
        filter: blur(30px);
    }

    .cm-brand-panel::after {
        display: none;
    }

    .cm-brand-header {
        justify-content: center;
        margin-bottom: 0;
        gap: 10px;
    }

    .cm-brand-logo-icon {
        width: 42px;
        height: 42px;
        font-size: 19px;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(56, 189, 248, 0.45);
    }

    .cm-brand-title {
        font-size: 24px;
        font-weight: 800;
    }
    
    .cm-brand-content {
        display: none;
    }

    .cm-brand-footer {
        display: block;
        text-align: center;
        padding: 16px;
        color: #475569;
        font-size: 11px;
    }
    
    .cm-form-panel {
        flex: 1;
        padding: 8px 16px 24px 16px;
        background: transparent;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
    }

    .cm-login-card {
        background: rgba(15, 23, 42, 0.75);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 24px;
        padding: 28px 22px;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
        max-width: 440px;
        width: 100%;
    }

    .cm-form-header {
        margin-bottom: 22px;
        text-align: center;
    }

    .cm-form-header h2 {
        font-size: 22px;
        font-weight: 800;
        color: #ffffff;
        letter-spacing: -0.02em;
    }

    .cm-form-header p {
        font-size: 13px;
        color: #94a3b8;
        margin-top: 4px;
    }

    .cm-input-group label {
        color: #cbd5e1;
        font-size: 12px;
        font-weight: 600;
        letter-spacing: 0.01em;
    }

    .cm-input {
        height: 46px;
        font-size: 13.5px;
        color: #ffffff;
        background-color: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
    }

    .cm-input::placeholder {
        color: #64748b;
    }

    .cm-input:focus {
        background-color: rgba(255, 255, 255, 0.07);
        border-color: #38bdf8;
        box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
    }

    .cm-input-icon {
        color: #64748b;
    }

    .cm-input:focus + .cm-input-icon,
    .cm-input-wrapper:focus-within .cm-input-icon {
        color: #38bdf8;
    }

    select.cm-input {
        background-color: rgba(15, 23, 42, 0.8);
        color: #ffffff;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2338bdf8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    }

    select.cm-input option {
        background: #0f172a;
        color: #ffffff;
    }

    .cm-btn-login {
        height: 48px;
        font-size: 14.5px;
        font-weight: 700;
        border-radius: 12px;
        background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
        box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
        margin-top: 12px;
    }

    .cm-btn-login:active {
        transform: scale(0.98);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    }
}

@media (max-width: 480px) {
    .cm-brand-panel {
        padding: 28px 16px 12px 16px;
    }

    .cm-login-card {
        padding: 24px 18px;
        border-radius: 20px;
    }
}

/* ==========================================================================
   Modern Notification & Database Status Indicators (2026 SaaS Design)
   ========================================================================== */

/* Label header row with live status pill */
.cm-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.cm-label-row label {
    margin-bottom: 0 !important;
}

.cm-db-status-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cm-db-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    transition: all 0.25s ease;
    cursor: default;
}

.cm-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

/* Status variants */
.cm-badge-online {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.cm-badge-online .cm-badge-dot {
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
}

.cm-badge-offline {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.cm-badge-offline .cm-badge-dot {
    background: #ef4444;
    box-shadow: 0 0 6px #ef4444;
    animation: cmPulseDot 1.5s infinite;
}

.cm-badge-checking {
    background: rgba(100, 116, 139, 0.12);
    color: #64748b;
    border: 1px solid rgba(100, 116, 139, 0.25);
}
.cm-badge-checking .cm-badge-dot {
    background: #94a3b8;
}

.cm-btn-test-db {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.cm-btn-test-db:hover {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
}

.cm-btn-test-db.cm-spinning i {
    animation: cmSpin 0.8s linear infinite;
}

/* Input validation error state */
.cm-input-invalid {
    border-color: #ef4444 !important;
    background-color: #fff5f5 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
    animation: cmShake 0.4s ease;
}

/* Inline Card Alert Banner */
.cm-alert-banner {
    display: none;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 20px;
    position: relative;
    border: 1px solid transparent;
    font-size: 13px;
    line-height: 1.45;
    animation: cmFadeDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cm-alert-icon {
    font-size: 18px;
    line-height: 1;
    margin-top: 2px;
    flex-shrink: 0;
}

.cm-alert-content {
    flex: 1;
}

.cm-alert-title {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 3px 0;
    letter-spacing: -0.01em;
}

.cm-alert-text {
    margin: 0;
    font-size: 12.5px;
    opacity: 0.92;
    word-break: break-word;
}

.cm-alert-close {
    background: transparent;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    padding: 0 4px;
    color: inherit;
    transition: opacity 0.2s ease;
    align-self: flex-start;
}

.cm-alert-close:hover {
    opacity: 1;
}

/* Alert Banner Themes */
.cm-alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}
.cm-alert-error .cm-alert-icon { color: #ef4444; }

.cm-alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}
.cm-alert-warning .cm-alert-icon { color: #f59e0b; }

.cm-alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}
.cm-alert-success .cm-alert-icon { color: #10b981; }

.cm-alert-info {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #075985;
}
.cm-alert-info .cm-alert-icon { color: #0284c7; }

/* Floating Modern Toast Notification Container */
.cm-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    width: calc(100vw - 48px);
    pointer-events: none;
}

/* Modern Glassmorphic Toast Card */
.cm-toast {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    color: #ffffff;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 20px 35px -8px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    animation: cmToastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: transform 0.2s ease, opacity 0.25s ease;
}

.cm-toast.cm-toast-closing {
    animation: cmToastOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.cm-toast-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.cm-toast-content {
    flex: 1;
    min-width: 0;
}

.cm-toast-title {
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 3px;
    letter-spacing: -0.01em;
    color: #f8fafc;
}

.cm-toast-message {
    font-size: 12.5px;
    line-height: 1.45;
    color: #cbd5e1;
    word-break: break-word;
}

.cm-toast-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 6px;
    transition: all 0.15s ease;
    align-self: flex-start;
}

.cm-toast-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

/* Toast Progress Bar */
.cm-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.4);
    width: 100%;
    transform-origin: left;
}

/* Toast Type Variations */
.cm-toast-error {
    border-left: 4px solid #ef4444;
}
.cm-toast-error .cm-toast-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}
.cm-toast-error .cm-toast-progress {
    background: #ef4444;
}

.cm-toast-warning {
    border-left: 4px solid #f59e0b;
}
.cm-toast-warning .cm-toast-icon {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}
.cm-toast-warning .cm-toast-progress {
    background: #f59e0b;
}

.cm-toast-success {
    border-left: 4px solid #10b981;
}
.cm-toast-success .cm-toast-icon {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}
.cm-toast-success .cm-toast-progress {
    background: #10b981;
}

.cm-toast-info {
    border-left: 4px solid #0ea5e9;
}
.cm-toast-info .cm-toast-icon {
    background: rgba(14, 165, 233, 0.2);
    color: #38bdf8;
    border: 1px solid rgba(14, 165, 233, 0.35);
}
.cm-toast-info .cm-toast-progress {
    background: #0ea5e9;
}

/* Animations */
@keyframes cmToastIn {
    0% {
        opacity: 0;
        transform: translateY(-16px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes cmToastOut {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-12px) scale(0.92);
    }
}

@keyframes cmFadeDown {
    0% {
        opacity: 0;
        transform: translateY(-8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cmPulseDot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(0.85);
    }
}

@keyframes cmSpin {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes cmShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Dark-mode compatibility in mobile view */
@media (max-width: 992px) {
    .cm-toast-container {
        top: 16px;
        right: 16px;
        left: 16px;
        width: auto;
        max-width: none;
    }

    .cm-db-badge.cm-badge-online {
        background: rgba(16, 185, 129, 0.2);
        color: #34d399;
    }

    .cm-db-badge.cm-badge-offline {
        background: rgba(239, 68, 68, 0.2);
        color: #f87171;
    }

    .cm-db-badge.cm-badge-checking {
        background: rgba(148, 163, 184, 0.15);
        color: #94a3b8;
    }

    .cm-btn-test-db {
        color: #94a3b8;
    }

    .cm-btn-test-db:hover {
        color: #38bdf8;
    }

    .cm-alert-banner.cm-alert-error {
        background: rgba(239, 68, 68, 0.15);
        border-color: rgba(239, 68, 68, 0.35);
        color: #fca5a5;
    }

    .cm-alert-banner.cm-alert-warning {
        background: rgba(245, 158, 11, 0.15);
        border-color: rgba(245, 158, 11, 0.35);
        color: #fcd34d;
    }
}
