:root {
    --primary-purple: #6a5acd;
    --primary-gradient: linear-gradient(135deg, #7b6fe6 0%, #5a4bce 100%);
    --secondary-yellow: #f1c40f;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --input-bg: #f8fafc;
}

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

body {
    font-family: 'Inter', sans-serif;
    /* Premium Dark Tech Background Gradient */
    background: #4e54c8;
    background: -webkit-linear-gradient(to left, #8f94fb, #4e54c8);
    background: linear-gradient(to left, #8f94fb, #4e54c8);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 20px;
}

h1, h2, h3, .logo-text, .btn-signin {
    font-family: 'Poppins', sans-serif;
}

/* --- ANIMATED BACKGROUND SQUARES --- */
.area {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.circles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.circles li {
    position: absolute;
    display: block;
    list-style: none;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    animation: animate 25s linear infinite;
    bottom: -150px;
    border-radius: 4px;
    backdrop-filter: blur(2px);
}

.circles li:nth-child(1) { left: 25%; width: 80px; height: 80px; animation-delay: 0s; }
.circles li:nth-child(2) { left: 10%; width: 20px; height: 20px; animation-delay: 2s; animation-duration: 12s; }
.circles li:nth-child(3) { left: 70%; width: 20px; height: 20px; animation-delay: 4s; }
.circles li:nth-child(4) { left: 40%; width: 60px; height: 60px; animation-delay: 0s; animation-duration: 18s; }
.circles li:nth-child(5) { left: 65%; width: 20px; height: 20px; animation-delay: 0s; }
.circles li:nth-child(6) { left: 75%; width: 110px; height: 110px; animation-delay: 3s; }
.circles li:nth-child(7) { left: 35%; width: 150px; height: 150px; animation-delay: 7s; }
.circles li:nth-child(8) { left: 50%; width: 25px; height: 25px; animation-delay: 15s; animation-duration: 45s; }
.circles li:nth-child(9) { left: 20%; width: 15px; height: 15px; animation-delay: 2s; animation-duration: 35s; }
.circles li:nth-child(10){ left: 85%; width: 150px; height: 150px; animation-delay: 0s; animation-duration: 11s; }

@keyframes animate {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
        border-radius: 0;
    }
    100% {
        transform: translateY(-1000px) rotate(720deg);
        opacity: 0;
        border-radius: 50%;
    }
}

.login-container {
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    overflow: hidden;
    width: 900px;
    max-width: 100%;
    min-height: 500px;
    position: relative;
    z-index: 10;
    margin: auto;
}

.left-panel {
    flex: 1;
    background: linear-gradient(135deg, #2c0e58 0%, #4834d4 50%, #130f40 100%);
    background-size: 200% 200%;
    animation: deep-space-pulse 15s ease infinite;
    padding: 25px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

@keyframes deep-space-pulse {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    mix-blend-mode: screen;
}

.left-panel-content {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 10px;
    border-radius: 24px;
    width: fit-content;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.8);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37), 
                0 0 0 1px rgba(255, 255, 255, 0.5) inset,
                0 4px 16px rgba(255, 255, 255, 0.6) inset;
    animation: float 6s ease-in-out infinite;
}

.brand-logo {
    max-width: 120px;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.logo-img-placeholder {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    transition: 0.3s;
}

.logo-img-placeholder:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
    cursor: pointer;
}

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

.logo-text {
    font-size: 2rem;
    font-weight: 800;
    font-style: italic;
    color: #ff9f43;
    text-shadow: 0 0 15px rgba(255, 159, 67, 0.4);
    letter-spacing: 0.5px;
    line-height: 1;
}

.logo-text span { 
    color: #4bcffa; 
    text-shadow: 0 0 15px rgba(75, 207, 250, 0.4); 
}

.logo-subtext {
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: #e2e8f0;
    font-weight: 500;
    text-transform: uppercase;
    margin-top: 5px;
    opacity: 0.8;
}

.left-panel h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
    font-weight: 700;
}

.left-panel p.description {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 15px;
    line-height: 1.5;
    max-width: 350px;
    color: #e2e8f0;
    font-weight: 400;
}

.features-list {
    list-style: none;
    text-align: left;
    width: 100%;
    max-width: 340px;
    background: rgba(0, 0, 0, 0.05);
    padding: 18px;
    border-radius: 16px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    animation: slideInUp 0.8s ease-out 0.5s both;
}

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

.features-list li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    font-size: 1rem;
    color: #f1f5f9;
    font-weight: 500;
    opacity: 0;
    animation: fadeInLeft 0.6s ease-out forwards;
    transition: all 0.3s ease;
}

.features-list li:nth-child(1) { animation-delay: 0.7s; }
.features-list li:nth-child(2) { animation-delay: 0.9s; }
.features-list li:nth-child(3) { animation-delay: 1.1s; }
.features-list li:nth-child(4) { animation-delay: 1.3s; }

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.features-list li:hover {
    transform: translateX(8px);
    color: #fff;
}

.features-list li:last-child { margin-bottom: 0; }

.features-list i {
    color: var(--secondary-yellow);
    margin-right: 15px;
    font-size: 1.2rem;
    text-shadow: 0 0 8px rgba(241, 196, 15, 0.6);
    width: 24px;
    text-align: center;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 0 8px rgba(241, 196, 15, 0.6);
    }
    50% {
        transform: scale(1.1);
        text-shadow: 0 0 16px rgba(241, 196, 15, 0.9);
    }
}

.features-list li:hover i {
    transform: scale(1.2) rotate(5deg);
    text-shadow: 0 0 20px rgba(241, 196, 15, 1);
}

.right-panel {
    flex: 1;
    padding: 35px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: white;
    position: relative;
    z-index: 20;
}

.right-panel h1 {
    color: var(--text-dark);
    font-size: 2rem;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.right-panel p.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 12px 12px 42px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--input-bg);
    font-size: 0.95rem;
    color: var(--text-dark);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-wrapper input::placeholder {
    color: #94a3b8;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #7b6fe6;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(123, 111, 230, 0.1);
}

.input-wrapper i.icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.1rem;
    transition: 0.3s;
}

.input-wrapper input:focus + i.icon {
    color: #7b6fe6;
}

.input-wrapper i.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    cursor: pointer;
    transition: 0.2s;
    padding: 5px;
}

.input-wrapper i.toggle-password:hover { 
    color: #64748b; 
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.remember-me {
    display: flex;
    align-items: center;
    color: #475569;
    cursor: pointer;
    font-weight: 500;
    user-select: none;
}

.remember-me input {
    margin-right: 10px;
    accent-color: var(--primary-purple);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.forgot-pass {
    color: #6c5ce7;
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s;
}

.forgot-pass:hover { 
    text-decoration: underline; 
    color: #5a4bce; 
}

.btn-signin {
    width: 100%;
    padding: 12px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px -5px rgba(106, 90, 205, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

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

.btn-signin:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -5px rgba(106, 90, 205, 0.5);
}

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

.divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.divider span {
    background-color: white;
    padding: 0 15px;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.divider::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background-color: #e2e8f0;
    z-index: 0;
}

.create-account {
    text-align: center;
    font-size: 0.95rem;
    color: #64748b;
}

.create-account a {
    color: #6c5ce7;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s;
}

.create-account a:hover { 
    color: #5a4bce; 
}

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@media (max-width: 1024px) {
    .login-container {
        max-width: 900px;
        min-height: 600px;
    }
}

@media (max-width: 850px) {
    .login-container {
        flex-direction: column;
        width: 100%;
        height: auto;
        max-width: 500px;
        min-height: auto;
    }

    .left-panel {
        min-height: 280px;
        padding: 30px 25px;
    }
    
    #particle-canvas {
        height: 280px;
    }

    .logo-box {
        margin-bottom: 15px;
        padding: 15px;
    }
    
    .features-list {
        display: none;
    }
    
    .left-panel h2 {
        font-size: 1.4rem;
        margin-bottom: 8px;
    }
    
    .left-panel p.description {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }
    
    .right-panel {
        padding: 30px 25px;
        min-height: auto;
    }
    
    .right-panel h1 {
        font-size: 1.6rem;
        margin-bottom: 6px;
    }
    
    .right-panel p.subtitle {
        font-size: 0.85rem;
        margin-bottom: 18px;
    }
    
    .input-group {
        margin-bottom: 12px;
    }
    
    .form-actions {
        margin-bottom: 16px;
    }
    
    .divider {
        margin: 16px 0;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
        align-items: flex-start;
    }

    .login-container {
        border-radius: 16px;
        min-height: auto;
        margin: 10px auto;
    }

    .left-panel {
        min-height: 240px;
        padding: 20px 18px;
    }
    
    #particle-canvas {
        height: 240px;
    }
    
    .logo-box {
        margin-bottom: 12px;
        padding: 12px;
    }
    
    .left-panel h2 {
        font-size: 1.25rem;
        margin-bottom: 6px;
    }
    
    .left-panel p.description {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }
    
    .right-panel {
        padding: 20px 18px;
    }
    
    .right-panel h1 {
        font-size: 1.4rem;
        margin-bottom: 5px;
    }
    
    .right-panel p.subtitle {
        font-size: 0.8rem;
        margin-bottom: 15px;
    }

    .input-group {
        margin-bottom: 10px;
    }
    
    .input-group label {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }

    .input-wrapper input {
        padding: 11px 11px 11px 38px;
        font-size: 0.9rem;
    }
    
    .input-wrapper i.icon {
        left: 13px;
        font-size: 1rem;
    }
    
    .input-wrapper i.toggle-password {
        right: 13px;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 14px;
    }
    
    .remember-me {
        font-size: 0.8rem;
    }
    
    .forgot-pass {
        font-size: 0.8rem;
    }
    
    .btn-signin {
        padding: 11px;
        font-size: 0.9rem;
    }
    
    .divider {
        margin: 14px 0;
    }
    
    .divider span {
        font-size: 0.75rem;
    }
    
    .create-account {
        font-size: 0.8rem;
    }
    
    .alert {
        padding: 9px 12px;
        font-size: 0.75rem;
        margin-bottom: 12px;
    }
}

@media (max-width: 375px) {
    body {
        padding: 8px;
    }
    
    .login-container {
        margin: 8px auto;
    }
    
    .left-panel {
        min-height: 220px;
        padding: 18px 15px;
    }
    
    #particle-canvas {
        height: 220px;
    }
    
    .logo-box {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .left-panel h2 {
        font-size: 1.15rem;
        margin-bottom: 5px;
    }
    
    .left-panel p.description {
        font-size: 0.75rem;
        margin-bottom: 6px;
    }
    
    .right-panel {
        padding: 18px 15px;
    }
    
    .right-panel h1 {
        font-size: 1.3rem;
        margin-bottom: 4px;
    }
    
    .right-panel p.subtitle {
        font-size: 0.75rem;
        margin-bottom: 12px;
    }
    
    .input-group {
        margin-bottom: 9px;
    }
    
    .input-group label {
        font-size: 0.75rem;
        margin-bottom: 3px;
    }
    
    .input-wrapper input {
        padding: 10px 10px 10px 36px;
        font-size: 0.85rem;
    }
    
    .input-wrapper i.icon {
        left: 12px;
        font-size: 0.95rem;
    }
    
    .input-wrapper i.toggle-password {
        right: 12px;
    }
    
    .form-actions {
        margin-bottom: 12px;
        gap: 8px;
    }
    
    .remember-me {
        font-size: 0.75rem;
    }
    
    .remember-me input {
        width: 16px;
        height: 16px;
        margin-right: 6px;
    }
    
    .forgot-pass {
        font-size: 0.75rem;
    }
    
    .btn-signin {
        padding: 10px;
        font-size: 0.85rem;
        gap: 6px;
    }
    
    .divider {
        margin: 12px 0;
    }
    
    .divider span {
        font-size: 0.7rem;
        padding: 0 10px;
    }
    
    .create-account {
        font-size: 0.75rem;
    }
    
    .alert {
        padding: 8px 10px;
        font-size: 0.7rem;
        margin-bottom: 10px;
    }
}

@media (min-width: 1440px) {
    .login-container {
        width: 1000px;
        min-height: 600px;
    }
    
    .right-panel h1 {
        font-size: 2.2rem;
    }
}

@media (min-width: 1920px) {
    .login-container {
        width: 1100px;
        min-height: 650px;
    }
    
    .left-panel {
        padding: 50px;
    }
    
    .right-panel {
        padding: 60px;
    }
    
    .right-panel h1 {
        font-size: 2.5rem;
    }
}

/* Extra small devices (320px and below) */
@media (max-width: 320px) {
    body {
        padding: 8px;
    }
    
    .left-panel {
        min-height: 240px;
        padding: 18px 12px;
    }
    
    .left-panel h2 {
        font-size: 1.1rem;
    }
    
    .left-panel p.description {
        font-size: 0.75rem;
    }
    
    .features-list {
        padding: 12px;
    }
    
    .features-list li {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }
    
    .right-panel {
        padding: 18px 12px;
    }
    
    .right-panel h1 {
        font-size: 1.25rem;
    }
    
    .right-panel p.subtitle {
        font-size: 0.75rem;
    }
    
    .input-wrapper input {
        padding: 10px 10px 10px 36px;
        font-size: 0.8rem;
    }
    
    .btn-signin {
        padding: 11px;
        font-size: 0.85rem;
    }
}

/* Landscape orientation optimization for mobile */
@media (max-width: 850px) and (orientation: landscape) {
    .left-panel {
        min-height: 280px;
        padding: 25px 30px;
    }
    
    .features-list {
        display: none;
    }
    
    .left-panel p.description {
        margin-bottom: 15px;
    }
}
