/**
 * Client Pulse – Login Page Styles
 */

/* ---- Variables (dark defaults, overridden by inline <style>) ---- */
#cp-login {
    --nncp-bg: #0b0d12;
    --nncp-surface: #121522;
    --nncp-surface-2: #161a2a;
    --nncp-card: #14182a;
    --nncp-text: #e8ebf2;
    --nncp-text-muted: #a9afbf;
    --nncp-text-dim: #7f879a;
    --nncp-border: rgba(255, 255, 255, 0.08);
    --nncp-border-strong: rgba(255, 255, 255, 0.12);
    --nncp-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    --nncp-accent: #4f9cff;
    --nncp-accent-2: #7dd3fc;
    --nncp-danger: #ef4444;
    --nncp-radius: 14px;
    --nncp-font: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* ---- Reset ---- */
#cp-login,
#cp-login *,
#cp-login *::before,
#cp-login *::after {
    box-sizing: border-box;
}

/* ---- Shell ---- */
.cp-login {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    font-family: var(--nncp-font);
    background: var(--nncp-bg);
    color: var(--nncp-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.cp-login__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    min-height: 100vh;
}

/* ---- Left column: Form ---- */
.cp-login__form-col {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: var(--nncp-bg);
    position: relative;
}

.cp-login__form-wrap {
    width: 100%;
    max-width: 400px;
}

/* Brand */
.cp-login__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
}

.cp-login__logo {
    height: 32px;
    width: auto;
}

.cp-login__brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--nncp-accent), var(--nncp-accent-2));
    flex-shrink: 0;
}


/* Form */
.cp-login__form {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Field */
.cp-login__field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cp-login__field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--nncp-text-muted);
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

#cp-login .cp-login__input {
    width: 100%;
    height: 52px;
    padding: 14px 16px 14px 18px;
    font-size: 15px;
    font-family: var(--nncp-font);
    color: var(--nncp-text);
    background: var(--nncp-surface-2);
    border: 1.5px solid var(--nncp-border-strong);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.12);
}

.cp-login__input::placeholder {
    color: var(--nncp-text-dim);
}

.cp-login__input:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: var(--nncp-surface);
}

.cp-login__input:focus {
    border-color: var(--nncp-accent);
    background: var(--nncp-surface);
    box-shadow: 0 0 0 3px rgba(79, 156, 255, 0.15), inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.cp-login__input.is-error {
    border-color: var(--nncp-danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12), inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Password toggle */
.cp-login__password-wrap {
    position: relative;
}

.cp-login__password-wrap .cp-login__input {
    padding-right: 52px;
}

.cp-login__toggle-pass {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--nncp-text-dim);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: color 0.15s ease, background 0.15s ease;
}

.cp-login__toggle-pass:hover {
    color: var(--nncp-text);
    background: rgba(255, 255, 255, 0.06);
}

/* Field error */
.cp-login__field-error {
    font-size: 12px;
    color: var(--nncp-danger);
    min-height: 0;
    overflow: hidden;
    transition: min-height 0.15s ease;
}

.cp-login__field-error:not(:empty) {
    min-height: 16px;
}

/* Options row */
.cp-login__options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: -4px;
}

.cp-login__remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--nncp-text-muted);
}

.cp-login__remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--nncp-accent);
    cursor: pointer;
    border-radius: 4px;
}

.cp-login__forgot {
    font-size: 13px;
    color: var(--nncp-accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.cp-login__forgot:hover {
    color: var(--nncp-accent-2);
}

/* Form-level error */
.cp-login__error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--nncp-danger);
    font-size: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    text-align: center;
    animation: cpShakeX 0.35s ease;
}

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

/* Submit */
.cp-login__submit {
    width: 100%;
    height: 54px;
    padding: 0 24px;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--nncp-font);
    color: #fff;
    background: linear-gradient(135deg, var(--nncp-accent), var(--nncp-accent-2));
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    box-shadow:
        0 4px 14px rgba(79, 156, 255, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    letter-spacing: 0.4px;
    margin-top: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.cp-login__submit:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(79, 156, 255, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    filter: brightness(1.05);
}

.cp-login__submit:active {
    transform: translateY(0);
    box-shadow:
        0 2px 8px rgba(79, 156, 255, 0.25),
        0 1px 2px rgba(0, 0, 0, 0.1),
        inset 0 1px 3px rgba(0, 0, 0, 0.1);
    filter: brightness(0.97);
}

.cp-login__submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    filter: none;
    box-shadow: none;
}

/* Footer */
.cp-login__footer {
    margin-top: 48px;
    font-size: 12px;
    color: var(--nncp-text-dim);
    text-align: center;
    letter-spacing: 0.5px;
}

/* ---- Right column: Image slider ---- */
.cp-login__image-col {
    position: relative;
    overflow: hidden;
    background: var(--nncp-surface);
}

.cp-login__slider {
    position: absolute;
    inset: 0;
}

.cp-login__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.cp-login__slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.cp-login__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Caption in the corner */
.cp-login__slide-caption {
    position: absolute;
    bottom: 24px;
    left: 24px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 8px;
    letter-spacing: 0.3px;
    z-index: 2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Dots navigation */
.cp-login__slider-dots {
    position: absolute;
    bottom: 24px;
    right: 24px;
    display: flex;
    gap: 8px;
    z-index: 2;
}

.cp-login__slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    padding: 0;
    transition: background 0.25s ease, transform 0.2s ease;
}

.cp-login__slider-dot.is-active {
    background: #fff;
    transform: scale(1.3);
}

.cp-login__slider-dot:hover:not(.is-active) {
    background: rgba(255, 255, 255, 0.6);
}

/* Subtle gradient overlay */
.cp-login__image-col::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.25) 0%,
        transparent 40%
    );
    pointer-events: none;
    z-index: 1;
}

/* ==================================================================
   Responsive
================================================================== */

/* Tablet landscape */
@media (max-width: 1024px) {
    .cp-login__inner {
        grid-template-columns: 1fr 1fr;
    }

    .cp-login__form-col {
        padding: 40px 32px;
    }
}

/* Tablet portrait */
@media (max-width: 820px) {
    .cp-login__inner {
        display: flex;
        flex-direction: column;
        gap: 30px;
        min-height: 100vh;
    }

    .cp-login__form-col {
        padding: 40px 40px 0;
        flex: 0 0 auto;
    }

    .cp-login__image-col {
        flex: 1 1 0;
        min-height: 90vh;
        position: relative;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .cp-login__form-col {
        padding: 20px 28px 0;
    }

    .cp-login__brand {
        margin-bottom: 18px;
        padding: 10px 0 10px 0px;
    }

    .cp-login__footer {
        margin-top: 36px;
    }

    .cp-login__slide-caption {
        bottom: 16px;
        left: 16px;
        font-size: 12px;
        padding: 6px 12px;
    }

    .cp-login__slider-dots {
        bottom: 16px;
        right: 16px;
    }
}
