/* ============================================================
   RedDev HR — Professional Login Page Styles
   Background: #842345 | Accent: inspired by #B9A3F1 palette
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --brand-red:    #842345;
    --brand-red-2:  #6b1a38;
    --brand-red-3:  #9e2c56;
    --accent:       #B9A3F1;
    --accent-dark:  #9b83e8;
    --accent-light: #d4c6f8;
    --white:        #ffffff;
    --off-white:    #f9f7ff;
    --text-dark:    #1a1a2e;
    --text-mid:     #4a4a6a;
    --text-light:   #8888aa;
    --border:       rgba(185, 163, 241, 0.25);
    --glass-bg:     rgba(255, 255, 255, 0.97);
    --shadow-card:  0 32px 80px rgba(132, 35, 69, 0.35);
    --shadow-input: 0 2px 12px rgba(132, 35, 69, 0.08);
    --radius-card:  28px;
    --radius-input: 14px;
    --radius-btn:   14px;
}

html, body {
    height: 100%;
    font-family: 'Inter', 'Plus Jakarta Sans', sans-serif;
    overflow-x: hidden;
}

/* ─── Background ─────────────────────────────────────────── */
.login-bg {
    min-height: 100vh;
    width: 100%;
    background: #842345;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animated blobs */
.login-bg::before {
    content: '';
    position: absolute;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(185,163,241,0.18) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
    animation: blobFloat 8s ease-in-out infinite alternate;
}

.login-bg::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(107,26,56,0.6) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
    animation: blobFloat 10s ease-in-out infinite alternate-reverse;
}

@keyframes blobFloat {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 30px) scale(1.08); }
}

/* Grid dots overlay */
.login-bg .bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* ─── Main Layout ────────────────────────────────────────── */
.login-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1100px;
    min-height: 600px;
    margin: 2rem auto;
    display: flex;
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

/* ─── Left Panel (Branding) ──────────────────────────────── */
.login-left {
    flex: 1.1;
    background: linear-gradient(155deg,
        rgba(255,255,255,0.06) 0%,
        rgba(255,255,255,0.02) 100%
    );
    backdrop-filter: blur(2px);
    border-right: 1px solid rgba(255,255,255,0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 3rem;
    position: relative;
    overflow: hidden;
}

/* Decorative circles on left panel */
.login-left .deco-circle-1 {
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    border: 1.5px solid rgba(185,163,241,0.15);
    top: -100px;
    left: -100px;
}
.login-left .deco-circle-2 {
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 1.5px solid rgba(185,163,241,0.12);
    bottom: -60px;
    right: -60px;
}

.brand-logo-wrap {
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.brand-mascot {
    width: 140px;
    height: 140px;
    object-fit: contain;
    filter: drop-shadow(0 12px 30px rgba(0,0,0,0.4));
    animation: mascotFloat 4s ease-in-out infinite;
    margin-bottom: 1.5rem;
}

@keyframes mascotFloat {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-12px); }
}

.brand-main-logo {
    max-width: 240px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.92;
}

.brand-tagline {
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 1.2rem;
    text-align: center;
}

/* Feature pills */
.feature-list {
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
    max-width: 280px;
}

.feature-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(185,163,241,0.2);
    border-radius: 50px;
    padding: 0.65rem 1.2rem;
    color: rgba(255,255,255,0.88);
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.feature-pill:hover {
    background: rgba(185,163,241,0.15);
    border-color: rgba(185,163,241,0.4);
    transform: translateX(4px);
}

.feature-pill i {
    color: var(--accent-light);
    font-size: 0.95rem;
    width: 16px;
    text-align: center;
}

/* ─── Right Panel (Form) ─────────────────────────────────── */
.login-right {
    flex: 1;
    background: var(--glass-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 3.2rem;
    position: relative;
}

/* Top accent bar */
.login-right::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-red), var(--accent), var(--brand-red-3));
}

.form-container {
    width: 100%;
    max-width: 380px;
}

/* Welcome heading */
.welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(132,35,69,0.08);
    border: 1px solid rgba(132,35,69,0.15);
    color: var(--brand-red);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    margin-bottom: 1.2rem;
}

.welcome-badge i {
    font-size: 0.7rem;
}

.form-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.2;
    margin-bottom: 0.4rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.form-subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 2.2rem;
    font-weight: 400;
}

/* ─── Alert ──────────────────────────────────────────────── */
.login-alert {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(220, 38, 38, 0.06);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-left: 4px solid #dc2626;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    color: #b91c1c;
    font-weight: 500;
    margin-bottom: 1.5rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-alert .alert-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #b91c1c;
    cursor: pointer;
    padding: 0;
    font-size: 0.9rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.login-alert .alert-close:hover { opacity: 1; }

/* ─── Form Fields ────────────────────────────────────────── */
.field-group {
    margin-bottom: 1.3rem;
}

.field-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-mid);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.field-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.field-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-light);
    font-size: 0.95rem;
    pointer-events: none;
    transition: color 0.2s;
    z-index: 2;
}

.field-input {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 2.8rem;
    border: 1.5px solid rgba(0,0,0,0.1);
    border-radius: var(--radius-input);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    background: var(--off-white);
    transition: all 0.25s ease;
    outline: none;
    box-shadow: var(--shadow-input);
}

.field-input::placeholder {
    color: #b0b0c8;
    font-weight: 400;
}

.field-input:focus {
    border-color: var(--brand-red);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(132, 35, 69, 0.08), var(--shadow-input);
}

.field-input:focus ~ .field-icon,
.field-input-wrap:focus-within .field-icon {
    color: var(--brand-red);
}

/* Toggle password icon */
.field-toggle {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0;
    transition: color 0.2s;
    z-index: 2;
}

.field-toggle:hover { color: var(--brand-red); }

/* ─── Remember / Forgot row ─────────────────────────────── */
.remember-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.85rem;
}

.custom-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.custom-check input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--brand-red);
    cursor: pointer;
    border-radius: 4px;
}

.custom-check span {
    font-size: 0.83rem;
    color: var(--text-mid);
    font-weight: 500;
}

/* Forgot password notice box */
.forgot-notice {
    display: block;
    background: rgba(132, 35, 69, 0.05);
    border: 1px solid rgba(132, 35, 69, 0.14);
    border-radius: 10px;
    padding: 0.65rem 1rem;
    font-size: 0.8rem;
    color: var(--text-mid);
    line-height: 1.5;
    margin-top: -0.2rem;
    margin-bottom: 1.4rem;
    white-space: normal;
    word-break: normal;
}

.forgot-notice i {
    color: var(--brand-red);
    font-size: 0.8rem;
    margin-right: 0.35rem;
}

.forgot-notice strong {
    color: var(--brand-red);
    font-weight: 600;
    white-space: nowrap;
}

/* ─── Sign In Button ─────────────────────────────────────── */
.btn-signin {
    width: 100%;
    padding: 0.95rem 1.5rem;
    background: linear-gradient(135deg, var(--brand-red) 0%, var(--brand-red-3) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-btn);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: all 0.3s ease;
    box-shadow: 0 6px 24px rgba(132, 35, 69, 0.4);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
}

.btn-signin::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
}

.btn-signin:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(132, 35, 69, 0.5);
}

.btn-signin:active {
    transform: translateY(0);
    box-shadow: 0 4px 16px rgba(132, 35, 69, 0.4);
}

.btn-signin .arrow-icon {
    transition: transform 0.3s ease;
}

.btn-signin:hover .arrow-icon {
    transform: translateX(4px);
}

/* Loading spinner on button */
.btn-signin .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ─── Footer ─────────────────────────────────────────────── */
.form-footer {
    margin-top: 2rem;
    text-align: center;
}

.form-footer p {
    font-size: 0.78rem;
    color: var(--text-light);
}

.form-footer a {
    color: var(--brand-red);
    font-weight: 600;
    text-decoration: none;
}

.form-footer .divider {
    margin: 0 0.4rem;
    color: #d0d0e0;
}

/* Copyright line */
.copyright {
    position: absolute;
    bottom: 1.5rem;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.35);
    pointer-events: none;
}

/* ─── Version badge ──────────────────────────────────────── */
.version-badge {
    position: absolute;
    bottom: 1rem;
    right: 1.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-light);
    letter-spacing: 0.05em;
}

/* ─── Fade-in Animation ──────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-fade-up {
    animation: fadeInUp 0.6s ease forwards;
}

.login-wrapper { animation: fadeInUp 0.5s ease forwards; }

/* ─── Responsive — Mobile ────────────────────────────────── */
@media (max-width: 768px) {
    .login-bg {
        align-items: flex-start;
        padding: 0;
    }

    .login-wrapper {
        flex-direction: column;
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
        box-shadow: none;
    }

    .login-left {
        flex: none;
        padding: 2.5rem 2rem 2rem;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .brand-mascot {
        width: 90px;
        height: 90px;
        margin-bottom: 1rem;
    }

    .brand-main-logo {
        max-width: 180px;
    }

    .feature-list {
        display: none;
    }

    .brand-tagline {
        font-size: 0.8rem;
    }

    .login-right {
        flex: none;
        padding: 2.5rem 1.6rem 3rem;
        min-height: auto;
    }

    .form-container {
        max-width: 100%;
    }

    .form-title {
        font-size: 1.6rem;
    }

    .login-left .deco-circle-1,
    .login-left .deco-circle-2 {
        display: none;
    }

    .copyright {
        position: static;
        margin-top: 1.5rem;
        color: var(--text-light);
    }

    .version-badge {
        position: static;
        display: block;
        text-align: center;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .login-right {
        padding: 2rem 1.2rem 2.5rem;
    }

    .form-title {
        font-size: 1.4rem;
    }

    .btn-signin {
        padding: 0.85rem 1rem;
    }
}

/* ─── Tablet ─────────────────────────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
    .login-wrapper {
        max-width: 900px;
        margin: 1.5rem;
    }

    .login-left {
        padding: 2.5rem 2rem;
    }

    .login-right {
        padding: 2.5rem 2.5rem;
    }

    .feature-list {
        max-width: 240px;
    }
}

/* ─── Decorative lines on left background ────────────────── */
.bg-lines {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-lines span {
    position: absolute;
    display: block;
    width: 1px;
    background: rgba(255,255,255,0.05);
    top: 0;
    bottom: 0;
}

.bg-lines span:nth-child(1) { left: 20%; }
.bg-lines span:nth-child(2) { left: 40%; }
.bg-lines span:nth-child(3) { left: 60%; }
.bg-lines span:nth-child(4) { left: 80%; }
