/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    min-height: 100vh;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

/* Left side - Login form with gradient that dynamically matches slideshow images */
.left-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gradient-color-1), var(--gradient-color-2));
    padding: 2rem;
    transition: background 1s ease-in-out;
    animation: gradientSync 15s infinite;
}

/* Define CSS variables for each slide's color scheme */
:root {
    --slide1-color-1: #0d3954;
    --slide1-color-2: #179b46;
    --slide2-color-1: #2c3e50;
    --slide2-color-2: #5d8ca8;
    --slide3-color-1: #1e4d3e;
    --slide3-color-2: #c99a3b;
}

/* Sync gradient with slideshow images */
@keyframes gradientSync {

    0%,
    5% {
        background: linear-gradient(135deg, var(--slide1-color-1), var(--slide1-color-2));
    }

    5.01%,
    33% {
        background: linear-gradient(135deg, var(--slide1-color-1), var(--slide1-color-2));
    }

    33.01%,
    38% {
        background: linear-gradient(135deg, var(--slide2-color-1), var(--slide2-color-2));
    }

    38.01%,
    66% {
        background: linear-gradient(135deg, var(--slide2-color-1), var(--slide2-color-2));
    }

    66.01%,
    71% {
        background: linear-gradient(135deg, var(--slide3-color-1), var(--slide3-color-2));
    }

    71.01%,
    100% {
        background: linear-gradient(135deg, var(--slide3-color-1), var(--slide3-color-2));
    }
}

.login-form {
    max-width: 400px;
    width: 100%;
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.d-flex {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.d-flex img {
    max-height: 60px;
    width: auto;
    object-fit: contain;
}

.login-form h1 {
    background: linear-gradient(135deg, #0d3954, #179b46);
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
    font-weight: 900;
    text-align: center;
}

.subtitle {
    color: #666;
    margin-bottom: 2rem;
    font-size: 0.95rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Unified input styling - consistent across all inputs */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: white;
    font-family: inherit;
    line-height: 1.5;
}

.form-input:focus {
    outline: none;
    border-color: #179b46;
}

/* Password wrapper styling - maintains consistent dimensions */
.password-wrapper {
    position: relative;
    width: 100%;
    display: block;
}

.password-wrapper .form-input {
    padding-right: 2.8rem;
    width: 100%;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    color: #888;
    font-size: 1.1rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.toggle-password:hover {
    color: #179b46;
    background: rgba(0, 0, 0, 0.05);
}

.toggle-password:focus {
    outline: none;
    color: #179b46;
}

.toggle-password i {
    pointer-events: none;
    font-size: 1.1rem;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #555;
    cursor: pointer;
}

.remember input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
}

.login-btn {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--slide1-color-1), var(--slide1-color-2));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(23, 155, 70, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

/* Right side - CSS Only Animated Slideshow */
.right-side {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #0d3954;
}

.slideshow {
    width: 100%;
    height: 100%;
    position: relative;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    animation: fadeAnimation 15s infinite;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Animation delays for each slide */
.slide1 {
    animation-delay: 0s;
}

.slide2 {
    animation-delay: 5s;
}

.slide3 {
    animation-delay: 10s;
}

/* Fade animation */
@keyframes fadeAnimation {
    0% {
        opacity: 0;
    }

    5% {
        opacity: 1;
    }

    33% {
        opacity: 1;
    }

    38% {
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

/* Tablet Responsive Design */
@media (max-width: 992px) {
    .left-side {
        padding: 1.5rem;
    }

    .login-form {
        padding: 2rem;
    }

    .form-input {
        padding: 0.7rem 1rem;
    }

    .password-wrapper .form-input {
        padding-right: 2.8rem;
    }

    .toggle-password {
        right: 12px;
    }
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .left-side {
        min-height: auto;
        padding: 1rem;
    }

    .right-side {
        min-height: 350px;
        order: -1;
    }

    .slideshow,
    .slide {
        height: 350px;
    }

    .login-form {
        padding: 1.5rem;
        margin: 1rem 0;
        max-width: 100%;
    }

    .d-flex img {
        max-height: 45px;
    }

    .login-form h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    .form-input {
        padding: 0.7rem 1rem;
        font-size: 16px;
    }

    .password-wrapper .form-input {
        padding-right: 2.8rem;
    }

    .toggle-password {
        right: 12px;
        width: 32px;
        height: 32px;
    }

    .toggle-password i {
        font-size: 1rem;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .login-btn {
        padding: 0.8rem;
        font-size: 0.95rem;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .left-side {
        padding: 0.75rem;
    }

    .login-form {
        padding: 1.25rem;
    }

    .d-flex {
        gap: 0.75rem;
    }

    .d-flex img {
        max-height: 38px;
    }

    .login-form h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.85rem;
        margin-bottom: 1.25rem;
    }

    .form-group label {
        font-size: 0.85rem;
    }

    .form-input {
        padding: 0.6rem 0.9rem;
        font-size: 15px;
    }

    .password-wrapper .form-input {
        padding-right: 2.6rem;
    }

    .toggle-password {
        right: 10px;
        width: 30px;
        height: 30px;
    }

    .toggle-password i {
        font-size: 0.95rem;
    }

    .remember {
        font-size: 0.85rem;
    }

    .right-side {
        min-height: 280px;
    }

    .slideshow,
    .slide {
        height: 280px;
    }
}

/* Extra Small Mobile Devices */
@media (max-width: 360px) {
    .right-side {
        min-height: 240px;
    }

    .slideshow,
    .slide {
        height: 240px;
    }

    .login-form {
        padding: 1rem;
    }

    .form-input {
        padding: 0.55rem 0.8rem;
    }

    .password-wrapper .form-input {
        padding-right: 2.4rem;
    }

    .toggle-password {
        right: 8px;
        width: 28px;
        height: 28px;
    }

    .toggle-password i {
        font-size: 0.9rem;
    }
}

/* Landscape Mode for Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .left-side {
        min-height: auto;
        padding: 0.75rem;
    }

    .right-side {
        min-height: 280px;
    }

    .slideshow,
    .slide {
        height: 280px;
    }

    .login-form {
        padding: 1rem;
        max-width: 500px;
        margin: 0.5rem auto;
    }

    .d-flex img {
        max-height: 35px;
    }

    .login-form h1 {
        font-size: 1.4rem;
        margin-bottom: 0.25rem;
    }

    .subtitle {
        margin-bottom: 1rem;
        font-size: 0.85rem;
    }

    .form-group {
        margin-bottom: 0.85rem;
    }

    .form-input {
        padding: 0.55rem 0.9rem;
    }

    .password-wrapper .form-input {
        padding-right: 2.6rem;
    }

    .toggle-password {
        right: 10px;
        width: 30px;
        height: 30px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .login-btn:hover {
        transform: none;
        box-shadow: none;
    }

    .login-btn:active {
        transform: translateY(-2px);
        box-shadow: 0 5px 20px rgba(23, 155, 70, 0.4);
    }

    .toggle-password {
        min-width: 40px;
        min-height: 40px;
    }

    .toggle-password:hover {
        background: transparent;
    }

    .toggle-password:active {
        background: rgba(0, 0, 0, 0.1);
    }
}

/* High-resolution displays */
@media (min-width: 1440px) {
    .login-form {
        max-width: 480px;
        padding: 3rem;
    }

    .login-form h1 {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .form-input {
        padding: 0.85rem 1.2rem;
        font-size: 1.05rem;
    }

    .password-wrapper .form-input {
        padding-right: 3.2rem;
    }

    .toggle-password {
        right: 14px;
        width: 32px;
        height: 32px;
    }

    .toggle-password i {
        font-size: 1.2rem;
    }
}

/* Ensure consistent box-sizing for all inputs */
input,
button {
    box-sizing: border-box;
}

/* Remove default button styles while maintaining functionality */
button.toggle-password {
    background: transparent;
    border: none;
    cursor: pointer;
}

/* Ensure password input and text input have identical appearance */
input[type="password"].form-input,
input[type="text"].form-input {
    -webkit-appearance: none;
    appearance: none;
}