/* auth.css - Login/Auth page styles */
.auth-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8f5e9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 0; /* Ensures gap at top and bottom */
}

.auth-container {
    width: 100%;
    max-width: 880px; /* Reduced from 1000px */
    padding: 20px;
    perspective: 1500px;
}

.auth-card {
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    /* Remove fixed min-height so it wraps content perfectly */
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.2);
    transform-style: preserve-3d;
    position: relative;
    background: transparent;
    width: 100%;
    display: grid; /* Use grid to stack faces dynamically */
}

.auth-card.is-flipped {
    transform: rotateY(180deg);
}

.auth-front, .auth-back {
    grid-area: 1 / 1; /* Both sit in the same grid cell */
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 20px;
    overflow: hidden;
    background: white;
    transition: visibility 0.4s;
    position: relative; /* Overrides previous absolute */
}

.auth-card.is-flipped .auth-front {
    pointer-events: none;
    visibility: hidden;
}

.auth-card:not(.is-flipped) .auth-back {
    pointer-events: none;
    visibility: hidden;
}

.auth-back {
    transform: rotateY(180deg);
}

.auth-left {
    background: linear-gradient(145deg, rgba(10, 30, 10, 0.8), rgba(20, 50, 20, 0.7)), url('../images/hrm-login.webp');
    background-size: cover;
    background-position: center;
    padding: 30px 25px; /* Reduced to make card more compact */
    display: flex;
    align-items: stretch;
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    top: -80px;
    right: -80px;
}

.auth-left::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    bottom: -50px;
    left: -50px;
}

.auth-left-content {
    position: relative;
    z-index: 1;
    color: white;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 35px;
}

.brand-logo-container {
    background: white;
    padding: 8px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.brand h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.auth-left-content h2 {
    font-size: 1.6rem; /* Reduced from 2rem */
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.auth-left-content .auth-desc {
    opacity: 0.9;
    line-height: 1.6;
    margin-bottom: 30px;
    font-size: 0.8rem;
    max-width: 80%;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
}

.feature-grid-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feature-grid-item i {
    font-size: 1.5rem;
    color: #4ade80;
}

.feature-grid-item h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0;
}

.feature-grid-item p {
    font-size: 0.75rem;
    opacity: 0.6;
    line-height: 1.4;
    margin: 0 !important;
}

.auth-right {
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px 30px; /* Reduced to make card more compact */
    overflow-y: auto; /* Allow scrolling if content overflows */
}

/* Custom scrollbar for auth-right */
.auth-right::-webkit-scrollbar {
    width: 6px;
}
.auth-right::-webkit-scrollbar-track {
    background: transparent;
}
.auth-right::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 10px;
}
.auth-right::-webkit-scrollbar-thumb:hover {
    background: #bdbdbd;
}

.login-form-wrapper {
    width: 100%;
}

.login-form-wrapper h3 {
    font-size: 1.4rem; /* Reduced from 1.6rem */
    font-weight: 700;
    color: #422b22;
    margin-bottom: 5px;
}

.login-subtitle {
    color: #888;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    width: 100%;
    display: block;
}

.input-wrapper i:first-child {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 0.9rem;
    z-index: 5;
}

.input-wrapper input {
    width: 100% !important;
    display: block;
    box-sizing: border-box;
    padding: 14px 45px;
    border: 1.5px solid #eee;
    border-radius: 12px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s;
    color: #333;
}

.input-wrapper input:focus {
    border-color: #1e8731;
}

.toggle-pass {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
    z-index: 10;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.toggle-pass:hover {
    color: #1e8731;
}

/* Hide default browser password toggle */
input::-ms-reveal,
input::-ms-clear {
    display: none;
}
input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button {
    visibility: hidden;
    display: none !important;
    pointer-events: none;
    position: absolute;
    right: 0;
}

.btn-full {
    width: 100%;
    padding: 14px;
    justify-content: center;
    font-size: 1rem;
    border-radius: 12px;
    margin-top: 10px;
    background: linear-gradient(135deg, #1e8731, #28a745);
    box-shadow: 0 5px 15px rgba(30, 135, 49, 0.35);
}

.btn-full:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 135, 49, 0.45);
}

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

.alert-error {
    background: #fce8e6;
    color: #d93025;
    border: 1px solid #f5c6c3;
}

.emp-link {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: #888;
}

.emp-link a {
    color: #1e8731;
    font-weight: 600;
    text-decoration: none;
}

@media (max-width: 768px) {
    .auth-container {
        padding: 15px;
    }
    .auth-card {
        border-radius: 16px;
    }
    .auth-right {
        padding: 30px 20px;
    }
    .auth-front, .auth-back {
        grid-template-columns: 1fr;
        height: 100%;
    }
    .auth-left {
        display: none;
    }
    .login-form-wrapper h3 {
        font-size: 1.3rem;
    }
}
