/* ==========================================================
   Bhati ERP - Login Screen
   ========================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", "Segoe UI", Roboto, sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 45%, #0ea5e9 100%);
    background-size: 200% 200%;
    animation: gradientShift 14s ease infinite;
    overflow: hidden;
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating decorative orbs */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .5;
    z-index: 0;
    animation: float 18s ease-in-out infinite;
}
body::before {
    width: 420px;
    height: 420px;
    top: -120px;
    left: -120px;
    background: radial-gradient(circle, #38bdf8, transparent 70%);
}
body::after {
    width: 480px;
    height: 480px;
    bottom: -160px;
    right: -140px;
    background: radial-gradient(circle, #818cf8, transparent 70%);
    animation-delay: -6s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-34px) scale(1.06); }
}

/* Subtle grid overlay */
.login-page {
    width: 100%;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 75%);
    pointer-events: none;
}

.login-card {
    max-width: 420px;
    margin: auto;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 22px;
    padding: 40px 35px 28px;
    box-shadow: 0 30px 70px rgba(2, 6, 23, .45);
    animation: cardIn .7s cubic-bezier(.16, 1, .3, 1);
}

.login-card.shake { animation: cardIn .7s cubic-bezier(.16, 1, .3, 1), shakeX .5s ease .35s; }

@keyframes cardIn {
    from { opacity: 0; transform: translateY(44px) scale(.97); }
    to   { opacity: 1; transform: none; }
}

.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.logo-circle {
    width: 76px;
    height: 76px;
    margin: 0 auto 16px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    box-shadow: 0 12px 28px rgba(37, 99, 235, .45);
    animation: logoPulse 3s ease-in-out infinite;
}

.logo-circle.logo-img {
    object-fit: cover;
    border-radius: 24px;
    transition: transform .3s cubic-bezier(.16, 1, .3, 1);
}
.logo-circle.logo-img:hover { transform: scale(1.05) rotate(-3deg); }

@keyframes logoPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.06); }
}

.logo-section h1 { font-size: 26px; color: #111827; letter-spacing: -.5px; }
.logo-section p  { color: #64748b; margin-top: 5px; font-size: 14px; }

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.field label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.field input {
    width: 100%;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    padding: 13px 15px;
    border-radius: 13px;
    font-size: 15px;
    color: #0f172a;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.field input::placeholder { color: #94a3b8; }

.field input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .14);
    background: #fff;
}

.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }

.toggle-pass {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #64748b;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, transform .15s ease;
}
.toggle-pass:hover { background: #e2e8f0; transform: translateY(-50%) scale(1.06); }

.remember {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    color: #475569;
    margin: 4px 0 22px;
    cursor: pointer;
    user-select: none;
}
.remember input {
    width: 17px;
    height: 17px;
    accent-color: #2563eb;
    cursor: pointer;
}

#loginBtn {
    width: 100%;
    border: none;
    padding: 15px;
    border-radius: 13px;
    cursor: pointer;
    color: white;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    transition: transform .18s ease, box-shadow .2s ease, opacity .2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
#loginBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(37, 99, 235, .4);
}
#loginBtn:active:not(:disabled) { transform: scale(.98); }
#loginBtn:disabled { opacity: .7; cursor: not-allowed; }

.btn-text { line-height: 1; }

.loader {
    display: none;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

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

#loginMessage {
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    min-height: 20px;
    border-radius: 10px;
    padding: 0;
    transition: all .2s ease;
}
#loginMessage.error {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 10px 12px;
    animation: shakeX .45s ease;
}
#loginMessage.success {
    color: #15803d;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 10px 12px;
}

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

.login-footer .customer-login-link {
    display: inline-block;
    color: #7dd3fc;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .4px;
    padding: 7px 16px;
    margin-bottom: 12px;
    border: 1px solid rgba(125, 211, 252, .35);
    border-radius: 20px;
    transition: background .2s, color .2s;
}
.login-footer .customer-login-link:hover {
    background: rgba(125, 211, 252, .12);
    color: #e0f2fe;
}

@media (max-width: 480px) {
    .login-card { padding: 32px 22px 22px; }
    .logo-section h1 { font-size: 23px; }
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
    body, body::before, body::after, .login-card, .logo-circle, #loginBtn, .field input {
        animation: none !important;
        transition-duration: .001ms !important;
    }
}
