﻿/* =========================================
   Matrix HRMS Login + Premium Popup - Clean + No Scroll
   Desktop same, Laptop + Mobile Fixed
========================================= */
* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

:root {
    --bg: #070d1f;
    --card: #0f172a;
    --border: rgba(255,255,255,.09);
    --primary: #2f6bff;
    --primary2: #1d4ed8;
    --green: #10b981;
    --green2: #059669;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --input: #1a2340;
    --ring: rgba(47,107,255,.28);
}
/* ---------- Base + Background ---------- */
body {
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-tap-highlight-color: transparent;
}

.mesh-gradient {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: radial-gradient(at 20% 20%, rgba(47,107,255,.28), transparent 55%), radial-gradient(at 85% 80%, rgba(16,185,129,.22), transparent 55%), radial-gradient(at 50% 50%, rgba(139,92,246,.14), transparent 60%);
    filter: blur(60px);
    pointer-events: none;
}

.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .18;
    z-index: 0;
    pointer-events: none;
}

.orb-1 {
    width: 420px;
    height: 420px;
    background: #2f6bff;
    top: -120px;
    right: -100px;
}

.orb-2 {
    width: 380px;
    height: 380px;
    background: #10b981;
    bottom: -120px;
    left: -80px;
}

/* ---------- Layout - Scroll Fix ---------- */
.hrms-page {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
}

.hrms-card {
    width: 1060px;
    max-width: 100%;
    min-height: 640px;
    margin: auto; /* flex center cut fix */
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: rgba(15,23,42,.9);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,.55);
    animation: up .6s cubic-bezier(.16,1,.3,1);
}

.hrms-single {
    width: 480px;
    max-width: 100%;
    min-height: auto;
    display: block;
}

@keyframes up {
    from {
        opacity: 0;
        transform: translateY(26px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ---------- Left Panel ---------- */
.hrms-left {
    position: relative;
    background: linear-gradient(135deg,#2563eb 0%,#1e40af 45%,#1e1b4b 100%);
    padding: 52px 46px;
    color: #fff;
    overflow: hidden;
    display: flex;
}

.hrms-left-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    margin: auto 0;
}

.logo-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

    .logo-row.center {
        justify-content: center;
    }

.logo-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 22px;
    flex-shrink: 0;
}

.logo-name {
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -.3px;
    line-height: 1.2;
}

.logo-sub {
    font-size: 12px;
    opacity: .75;
}

.hrms-left h1 {
    font-size: 38px;
    line-height: 1.15;
    letter-spacing: -1px;
    margin: 0 0 14px;
}

.left-desc {
    opacity: .85;
    line-height: 1.6;
    margin: 0 0 28px;
    font-size: 15px;
}

.left-points {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 32px;
}

.point {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.15);
    padding: 12px 15px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 10px #34d399;
    flex-shrink: 0;
}

.left-stats {
    display: flex;
    gap: 14px;
}

.stat {
    flex: 1;
    background: rgba(0,0,0,.25);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px;
    padding: 14px;
    text-align: center;
}

    .stat b {
        display: block;
        font-size: 18px;
    }

    .stat span {
        font-size: 12px;
        opacity: .7;
    }

.left-circle {
    position: absolute;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50%;
    pointer-events: none;
}

.c1 {
    width: 280px;
    height: 280px;
    right: -80px;
    bottom: -80px;
}

.c2 {
    width: 160px;
    height: 160px;
    right: 60px;
    top: -50px;
}

/* ---------- Right / Form ---------- */
.hrms-right {
    padding: 52px 52px 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

    .hrms-right.full {
        padding: 44px 40px;
    }

.right-head h2 {
    margin: 0 0 6px;
    font-size: 28px;
    letter-spacing: -.6px;
    line-height: 1.2;
}

.right-head p {
    margin: 0 0 26px;
    color: var(--muted);
    font-size: 14px;
}

.error-msg {
    background: rgba(239,68,68,.12);
    border: 1px solid rgba(239,68,68,.35);
    color: #fca5a5;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    margin-bottom: 18px;
    line-height: 1.5;
    display: none;
}

    .error-msg.show, div[id$='loginError']:not([style*='none']) {
        display: block;
    }

    .error-msg:empty {
        display: none !important;
    }

#loginError.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.form-group {
    margin-bottom: 20px;
}

.field-label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-ico {
    position: absolute;
    left: 14px;
    font-size: 15px;
    opacity: .7;
    z-index: 2;
    pointer-events: none;
}

.form-control {
    width: 100%;
    height: 52px;
    background: var(--input);
    border: 1.5px solid rgba(148,163,184,.22);
    border-radius: 12px;
    color: var(--text);
    font-size: 15px;
    padding: 0 16px;
    outline: none;
    transition: .25s;
    font-family: inherit;
}

    .form-control.has-icon {
        padding-left: 42px;
    }

    .form-control.has-eye {
        padding-right: 44px;
    }

    .form-control:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 4px var(--ring);
        background: #1e2a52;
    }

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

    select.form-control option {
        background: #fff;
        color: #0f172a;
    }

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 17px;
    opacity: .6;
    padding: 6px;
    line-height: 1;
}

    .toggle-password:hover {
        opacity: 1;
    }

.row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 4px 0 22px;
}

.secure-note {
    font-size: 13px;
    color: var(--muted);
}

.forgot-link {
    font-size: 13.5px;
    color: #60a5fa;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

    .forgot-link:hover {
        text-decoration: underline;
    }

.btn-main {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 13px;
    font-size: 15.5px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: .25s;
    display: block;
    touch-action: manipulation;
}

.btn-login {
    background: linear-gradient(135deg,var(--primary),var(--primary2));
    color: #fff;
    box-shadow: 0 10px 28px rgba(47,107,255,.4);
}

    .btn-login:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 34px rgba(47,107,255,.5);
    }

    .btn-login:active, .btn-attendance:active {
        transform: translateY(0);
    }

.btn-attendance {
    background: linear-gradient(135deg,var(--green),var(--green2));
    color: #fff;
    box-shadow: 0 10px 28px rgba(16,185,129,.35);
    margin-top: 2px;
}

    .btn-attendance:hover {
        transform: translateY(-2px);
    }

.divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--muted);
    font-size: 13px;
}

    .divider::before, .divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--border);
    }

    .divider span {
        padding: 0 12px;
    }

.foot-note {
    text-align: center;
    color: var(--muted);
    font-size: 12.5px;
    margin: 18px 0 0;
    line-height: 1.5;
}

/* ---------- Loader ---------- */
#loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(7,13,31,.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 20px;
    text-align: center;
}

    #loading-overlay.show {
        display: flex;
    }

.spinner {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,.15);
    border-top-color: var(--primary);
    animation: spin .7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#loading-overlay h3 {
    margin: 0;
    font-size: 18px;
    color: #fff;
}

#loading-overlay p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

/* ---------- PREMIUM MODAL ---------- */
#modal-success {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10002 !important;
    display: none !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity .25s ease;
}

    #modal-success.in {
        display: flex !important;
        opacity: 1 !important;
    }

    #modal-success .modal-dialog {
        width: 100%;
        max-width: 440px;
        margin: 0 auto;
        position: relative;
        z-index: 10003;
        transform: translateY(22px) scale(.96);
        opacity: 0;
        transition: all .32s cubic-bezier(.16,1,.3,1);
        max-height: calc(100vh - 40px);
        max-height: calc(100dvh - 40px);
        overflow-y: auto;
        border-radius: 20px;
    }

    #modal-success.in .modal-dialog {
        transform: none;
        opacity: 1;
    }

    #modal-success .modal-content {
        position: relative;
        overflow: hidden;
        background: linear-gradient(180deg, #162040 0%, #0f172a 100%) !important;
        border: 1px solid rgba(255,255,255,.12) !important;
        border-radius: 20px !important;
        color: var(--text) !important;
        box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.04) inset !important;
        animation: modalPop .35s cubic-bezier(.16,1,.3,1);
    }

@keyframes modalPop {
    from {
        transform: scale(.94) translateY(12px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

#modal-success .modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), #10b981);
}

#modal-success .modal-content.is-success::before {
    background: linear-gradient(90deg,#10b981,#34d399);
}

#modal-success .modal-content.is-error::before {
    background: linear-gradient(90deg,#ef4444,#f87171);
}

#modal-success .modal-content.is-info::before {
    background: linear-gradient(90deg,#f59e0b,#fbbf24);
}

#modal-success .modal-header {
    border: none !important;
    padding: 30px 28px 0 !important;
    text-align: center;
    position: relative;
}

    #modal-success .modal-header::before {
        content: '✓';
        width: 62px;
        height: 62px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 28px;
        font-weight: 800;
        color: #fff;
        margin: 0 auto 16px;
        background: linear-gradient(135deg,#10b981,#059669);
        box-shadow: 0 10px 28px rgba(16,185,129,.45);
    }

#modal-success .modal-content.is-error .modal-header::before {
    content: '!';
    background: linear-gradient(135deg,#ef4444,#dc2626);
    box-shadow: 0 10px 28px rgba(239,68,68,.45);
}

#modal-success .modal-title, #modal-success .modal-title span {
    color: #fff !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    letter-spacing: -.3px;
    display: block !important;
    margin: 0 !important;
    line-height: 1.3;
}

#modal-success .modal-body {
    padding: 12px 28px 6px !important;
    text-align: center;
}

    #modal-success .modal-body p, #modal-success .modal-body span {
        color: #cbd5e1 !important;
        font-size: 14.5px !important;
        line-height: 1.65 !important;
        display: block !important;
        margin: 0 !important;
        word-break: break-word;
    }

    #modal-success .modal-body b {
        color: #fff !important;
        font-weight: 700;
    }

#modal-success .modal-footer {
    border: none !important;
    padding: 22px 28px 28px !important;
    text-align: center;
}

    #modal-success .modal-footer .btn, #modal-success .modal-footer .btn-default {
        width: 100%;
        height: 48px;
        border: none !important;
        border-radius: 12px !important;
        background: linear-gradient(135deg,var(--primary),var(--primary2)) !important;
        color: #fff !important;
        font-weight: 700 !important;
        font-size: 15px !important;
        box-shadow: 0 8px 24px rgba(47,107,255,.35);
        opacity: 1 !important;
        text-shadow: none !important;
    }

#modal-success .close {
    position: absolute !important;
    top: 14px !important;
    right: 14px !important;
    width: 32px;
    height: 32px;
    border-radius: 50% !important;
    background: rgba(255,255,255,.08) !important;
    color: #fff !important;
    opacity: .7 !important;
    font-size: 20px !important;
    line-height: 1 !important;
    margin: 0 !important;
    text-shadow: none !important;
    float: none !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

    #modal-success .close:hover {
        opacity: 1 !important;
        background: rgba(255,255,255,.15) !important;
    }

    #modal-success .close span {
        color: #fff !important;
    }

.modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10001 !important;
    background: rgba(3,7,20,.7) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* ---------- Laptop height fix - scroll khatm ---------- */
@media (min-width: 921px) and (max-height: 820px) {
    .hrms-page {
        padding: 18px;
    }

    .hrms-card {
        min-height: 0;
    }

    .hrms-left {
        padding: 36px 38px;
    }

    .hrms-right {
        padding: 36px 40px 30px;
    }

    .logo-row {
        margin-bottom: 20px;
    }

    .hrms-left h1 {
        font-size: 32px;
        margin-bottom: 10px;
    }

    .left-desc {
        margin-bottom: 18px;
        font-size: 14px;
    }

    .left-points {
        gap: 10px;
        margin-bottom: 20px;
    }

    .point {
        padding: 10px 14px;
        font-size: 13.5px;
    }

    .stat {
        padding: 10px;
    }

    .right-head p {
        margin-bottom: 18px;
    }

    .form-group {
        margin-bottom: 14px;
    }

    .form-control, .btn-main {
        height: 48px;
    }

    .row-between {
        margin: 2px 0 16px;
    }

    .divider {
        margin: 16px 0;
    }

    .foot-note {
        margin-top: 12px;
    }
}

/* ---------- Tablet ---------- */
@media(max-width:920px) {
    .hrms-page {
        padding: 16px;
        align-items: flex-start;
        min-height: 100dvh;
    }

    .hrms-card {
        grid-template-columns: 1fr;
        min-height: auto;
        margin: 0 auto;
        border-radius: 18px;
    }

    .hrms-left {
        padding: 28px 24px;
    }

        .hrms-left h1 {
            font-size: 27px;
        }

    .left-desc {
        font-size: 14px;
        margin-bottom: 18px;
    }

    .left-points {
        gap: 10px;
        margin-bottom: 0;
    }

    .point {
        font-size: 13.5px;
        padding: 10px 13px;
    }

    .left-stats {
        display: none;
    }

    .hrms-right {
        padding: 28px 22px;
    }

    .right-head h2 {
        font-size: 24px;
    }
}

/* ---------- Mobile - premium + no zoom ---------- */
@media(max-width:560px) {
    body {
        background: #070d1f;
    }

    .orb-1 {
        width: 280px;
        height: 280px;
        top: -100px;
        right: -80px;
    }

    .orb-2 {
        width: 260px;
        height: 260px;
        bottom: -80px;
        left: -60px;
    }

    .hrms-page {
        padding: 12px;
    }

    .hrms-card {
        border-radius: 16px;
        box-shadow: 0 18px 50px rgba(0,0,0,.5);
    }

    .hrms-left {
        padding: 24px 18px;
    }

    .logo-row {
        margin-bottom: 18px;
        gap: 10px;
    }

    .logo-mark {
        width: 42px;
        height: 42px;
        font-size: 19px;
        border-radius: 12px;
    }

    .logo-name {
        font-size: 17px;
    }

    .hrms-left h1 {
        font-size: 23px;
        letter-spacing: -.5px;
    }

    .left-desc {
        font-size: 13.5px;
    }

    .hrms-right, .hrms-right.full {
        padding: 24px 18px;
    }

    .right-head h2 {
        font-size: 22px;
    }

    .right-head p {
        font-size: 13px;
        margin-bottom: 18px;
    }

    .form-group {
        margin-bottom: 14px;
    }

    .form-control {
        height: 48px;
        font-size: 16px;
    }
    /* iOS zoom fix */
    .btn-main {
        height: 48px;
        font-size: 15px;
        border-radius: 12px;
    }

        .btn-main:hover {
            transform: none;
        }

    .row-between {
        margin: 2px 0 16px;
    }

    .secure-note {
        font-size: 12px;
    }

    .forgot-link {
        font-size: 12.5px;
    }

    .divider {
        margin: 16px 0;
    }

    .foot-note {
        font-size: 12px;
    }

    #modal-success {
        padding: 12px;
    }

        #modal-success .modal-header {
            padding: 24px 20px 0 !important;
        }

            #modal-success .modal-header::before {
                width: 54px;
                height: 54px;
                font-size: 24px;
            }

        #modal-success .modal-title, #modal-success .modal-title span {
            font-size: 18px !important;
        }

        #modal-success .modal-body {
            padding: 10px 20px 4px !important;
        }

        #modal-success .modal-footer {
            padding: 18px 20px 22px !important;
        }
}

@media (prefers-reduced-motion: reduce) {
    .hrms-card, #modal-success .modal-dialog, #modal-success .modal-content {
        animation: none !important;
        transition: none !important;
    }
}
