:root {
    --site-blue: #0d6efd;
    --site-navy: #1a237e;
    --site-primary: #2563eb;
    --site-primary-dark: #1d4ed8;
    --site-text: #111827;
    --site-muted: #6b7280;
    --site-border: #e5e7eb;
    --site-bg: #f4f7fb;
    --site-teal: #0d6e6e;
}

* { box-sizing: border-box; }

.master-login-body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--site-bg);
    color: var(--site-text);
    -webkit-font-smoothing: antialiased;
}

.login-split {
    display: flex;
    min-height: 100vh;
}

/* Left showcase panel */
.login-showcase {
    flex: 1;
    position: relative;
    background: linear-gradient(145deg, var(--site-blue) 0%, var(--site-navy) 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
}

.showcase-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.12;
    background-image: radial-gradient(circle at 2px 2px, #fff 1px, transparent 0);
    background-size: 28px 28px;
}

.showcase-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
}

.showcase-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 32px;
    color: #fff;
}

.showcase-logo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff;
    padding: 4px;
    object-fit: contain;
}

.showcase-brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.2;
}

.showcase-brand-sub {
    font-size: .85rem;
    opacity: .85;
    margin-top: 2px;
}

.showcase-mockup {
    margin-bottom: 28px;
    perspective: 800px;
}

.mockup-window {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform: rotateY(-4deg) rotateX(2deg);
}

.mockup-bar {
    display: flex;
    gap: 6px;
    padding: 12px 14px;
    background: #f1f5f9;
    border-bottom: 1px solid var(--site-border);
}

.mockup-bar span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd5e1;
}

.mockup-bar span:first-child { background: #f87171; }
.mockup-bar span:nth-child(2) { background: #fbbf24; }
.mockup-bar span:nth-child(3) { background: #4ade80; }

.mockup-body { padding: 16px; }

.mockup-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.mock-stat {
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.mockup-chart-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.mock-chart {
    border-radius: 10px;
    min-height: 90px;
}

.mock-chart-bar {
    background: linear-gradient(180deg, #dbeafe 0%, #eff6ff 40%, #fff 100%);
    position: relative;
}

.mock-chart-bar::after {
    content: '';
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    height: 50px;
    background: repeating-linear-gradient(
        90deg,
        var(--site-primary) 0,
        var(--site-primary) 14px,
        transparent 14px,
        transparent 22px
    );
    opacity: 0.5;
    border-radius: 4px;
}

.mock-chart-donut {
    background: conic-gradient(var(--site-primary) 0 35%, var(--site-teal) 35% 60%, #c5a028 60% 80%, #e2e8f0 80%);
    border-radius: 50%;
    width: 90px;
    height: 90px;
    margin: auto;
}

.mockup-table {
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 50%, #f8fafc 100%);
}

.showcase-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.showcase-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: .82rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.showcase-pill i { font-size: .95rem; opacity: .9; }

/* Right form panel */
.login-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    background: #fff;
}

.login-form-wrap {
    width: 100%;
    max-width: 420px;
}

.login-form-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
    padding: 4px;
    box-shadow: 0 4px 20px rgba(26, 35, 126, 0.12);
    margin-bottom: 12px;
}

.login-brand-name {
    font-size: .88rem;
    font-weight: 700;
    color: var(--site-primary-dark);
    margin-bottom: 4px;
}

.login-page-title {
    margin: 0 0 8px;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--site-text);
    letter-spacing: -0.02em;
}

.login-page-sub {
    margin: 0;
    font-size: .92rem;
    color: var(--site-muted);
    line-height: 1.5;
}

.login-card {
    background: #fff;
    border: 1px solid var(--site-border);
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.06);
}

.login-field {
    margin-bottom: 18px;
}

.login-field label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--site-text);
    margin-bottom: 8px;
}

.req { color: #dc2626; }

.phone-input-row {
    display: flex;
    align-items: stretch;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}

.phone-input-row:focus-within {
    border-color: var(--site-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.phone-prefix {
    display: flex;
    align-items: center;
    padding: 0 14px;
    background: #f8fafc;
    border-right: 1px solid var(--site-border);
    font-weight: 600;
    color: var(--site-muted);
    font-size: 15px;
}

.login-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    padding: 14px 16px;
    font-size: 16px;
    background: transparent;
}

.login-note {
    margin: 8px 0 0;
    font-size: 12px;
    color: #94a3b8;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--site-muted);
}

.login-remember label {
    margin: 0;
    font-weight: 500;
    cursor: pointer;
}

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, opacity .15s;
}

.login-btn-primary {
    background: linear-gradient(135deg, var(--site-teal), #0a5555);
    color: #fff;
    box-shadow: 0 6px 20px rgba(13, 110, 110, 0.3);
}

.login-btn-primary:hover {
    box-shadow: 0 8px 24px rgba(13, 110, 110, 0.4);
}

.login-btn-verify {
    background: linear-gradient(135deg, var(--site-primary), var(--site-primary-dark));
    color: #fff;
    width: auto;
    min-width: 100px;
    padding: 0 20px;
    flex-shrink: 0;
}

.login-btn:active:not(:disabled) { transform: scale(0.98); }
.login-btn:disabled { opacity: .6; pointer-events: none; }

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 20px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--site-border);
}

.login-otp-panel { margin-top: 4px; }

.otp-input-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.otp-input-row .login-input {
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 14px 16px;
}

.otp-input-row .login-input:focus {
    border-color: var(--site-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.login-otp-status {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #16a34a;
}

.login-otp-status.error { color: #dc2626; }

.login-back-link {
    display: block;
    text-align: center;
    margin-top: 24px;
    color: var(--site-teal);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.login-back-link:hover { color: var(--site-navy); }

.login-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
}

#authMessage {
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 16px;
}

@media (max-width: 991.98px) {
    .login-split { flex-direction: column; }

    .login-showcase {
        min-height: auto;
        padding: 28px 20px;
    }

    .showcase-mockup { display: none; }

    .showcase-pills {
        justify-content: center;
    }

    .showcase-pill {
        font-size: .75rem;
        padding: 6px 12px;
    }

    .login-form-side {
        padding: 28px 20px 36px;
    }
}

@media (max-width: 575.98px) {
    .login-page-title { font-size: 1.45rem; }
    .login-card { padding: 22px 18px; }
    .otp-input-row { flex-direction: column; }
    .login-btn-verify { width: 100%; }
}
