/* CRM Pro — professional login page (fixed viewport, no scroll) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Lock viewport ── */
html:has(body.login-page) {
    height: 100%;
    overflow: hidden;
}

body.login-page {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    overscroll-behavior: none;
    background: #020617;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    display: block;
}

/* ── Full-page shell ── */
.login-page-shell {
    --cursor-x: 50%;
    --cursor-y: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    padding: 16px;
    box-sizing: border-box;
    background: radial-gradient(circle at top, #0b1120, #020617 60%);
}

.login-page-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.9;
    background:
        radial-gradient(circle at var(--cursor-x) var(--cursor-y), rgba(56, 189, 248, 0.22), transparent 55%),
        radial-gradient(circle at top, rgba(15, 23, 42, 0.7), transparent 60%);
}

.login-page-shell .tech-grid {
    position: absolute;
    inset: 0;
    opacity: 0.3;
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.8) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.8) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: loginGridPan 18s linear infinite;
    pointer-events: none;
}

.login-page-shell .floating-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.login-page-shell .floating-shape {
    position: absolute;
    width: 80px;
    height: 2px;
    border-radius: 999px;
    opacity: 0.7;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.15), rgba(129, 140, 248, 0.7));
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.7));
}

.login-page-shell .shape-1 { top: 18%; left: 20%; animation: loginFloat1 12s ease-in-out infinite; }
.login-page-shell .shape-2 { top: 30%; right: 18%; width: 110px; animation: loginFloat2 16s ease-in-out infinite; }
.login-page-shell .shape-3 { top: 52%; left: 14%; width: 60px; animation: loginFloat3 14s ease-in-out infinite; }
.login-page-shell .shape-4 { bottom: 22%; right: 24%; width: 95px; animation: loginFloat1 18s ease-in-out infinite reverse; }
.login-page-shell .shape-5 { bottom: 14%; left: 32%; width: 70px; animation: loginFloat2 20s ease-in-out infinite reverse; }

.login-main {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 420px;
    max-height: 100%;
    flex-shrink: 1;
    min-height: 0;
}

/* ── Glass card ── */
.login-card {
    position: relative;
    width: 100%;
    max-height: 100%;
    padding: 36px 32px 28px;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.18), rgba(118, 75, 162, 0.14));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    animation: loginSlideUp 0.45s ease-out;
}

.login-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.55;
    background:
        radial-gradient(circle at top, rgba(56, 189, 248, 0.28), transparent 55%),
        radial-gradient(circle at bottom, rgba(129, 140, 248, 0.22), transparent 55%);
}

.login-card > * {
    position: relative;
    z-index: 1;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}

.login-logo__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 17px;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.login-logo h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #f8fafc;
}

.login-card-intro {
    text-align: center;
}

.login-card-intro h3 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -0.02em;
}

.login-card-intro p {
    margin: 0;
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.5;
}

/* ── Alerts ── */
.login-alerts {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-alert {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
}

.login-alert i {
    margin-top: 2px;
    flex-shrink: 0;
}

.login-alert--success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #86efac;
}

.login-alert--error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.login-alert--info,
.login-alert--warning {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #7dd3fc;
}

/* ── Form ── */
.login-card-form {
    margin: 22px 0 0;
    padding: 0;
}

.login-card-form .form-group {
    margin-bottom: 16px;
}

.login-card-form .form-group:last-of-type {
    margin-bottom: 0;
}

.login-card-form .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
}

.login-card-form .input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.login-card-form .input-icon {
    position: absolute;
    left: 14px;
    z-index: 2;
    font-size: 15px;
    line-height: 1;
    pointer-events: none;
}

.login-card-form .input-wrapper:focus-within .input-icon {
    filter: none;
}

.login-card-form .input-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 2px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    color: #f1f5f9;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
}

.login-card-form .input-wrapper--password input {
    padding-right: 44px;
}

.login-card-form .input-wrapper input::placeholder {
    color: #64748b;
}

.login-card-form .input-wrapper input:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.7);
    background: rgba(15, 23, 42, 0.75);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.login-card-form .form-help {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    color: #64748b;
}

.login-card-form .form-help.is-valid {
    color: #4ade80;
}

.login-card-form .toggle-password {
    position: absolute;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.login-card-form .toggle-password:hover {
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.12);
}

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 18px;
    padding: 13px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.35);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.45);
}

.login-btn:hover::before {
    left: 100%;
}

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

.login-btn span {
    font-size: 17px;
    line-height: 1;
}

.login-card-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    text-align: center;
    background: none;
}

.login-card-footer p {
    margin: 0;
    font-size: 11px;
    color: #64748b;
}

/* ── Animations ── */
@keyframes loginGridPan {
    from { background-position: 0 0; }
    to { background-position: -40px -40px; }
}

@keyframes loginFloat1 {
    0%, 100% { opacity: 0.7; transform: translate3d(0, 0, 0) rotate(8deg); }
    50% { opacity: 1; transform: translate3d(14px, -10px, 0) rotate(16deg); }
}

@keyframes loginFloat2 {
    0%, 100% { opacity: 0.6; transform: translate3d(0, 0, 0) rotate(-10deg); }
    50% { opacity: 1; transform: translate3d(-18px, 12px, 0) rotate(-2deg); }
}

@keyframes loginFloat3 {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(3deg); }
    50% { transform: translate3d(8px, 16px, 0) rotate(-5deg); }
}

@keyframes loginSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-height: 680px) {
    .login-page-shell {
        padding: 10px 14px;
    }

    .login-card {
        padding: 24px 20px 20px;
    }

    .login-logo {
        margin-bottom: 10px;
    }

    .login-logo__icon {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }

    .login-logo h2 {
        font-size: 20px;
    }

    .login-card-intro h3 {
        font-size: 18px;
    }

    .login-card-form {
        margin-top: 16px;
    }

    .login-card-form .form-group {
        margin-bottom: 12px;
    }

    .login-card-form .form-help {
        display: none;
    }

    .login-btn {
        margin-top: 14px;
        padding: 11px;
    }

    .login-card-footer {
        margin-top: 14px;
        padding-top: 12px;
    }
}

@media (max-width: 380px) {
    .login-card {
        padding: 24px 18px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-page-shell .tech-grid,
    .login-page-shell .floating-shape,
    .login-card {
        animation: none;
    }
}
