body {
    font-family: Arial, sans-serif;
    background-image: linear-gradient(to right, #0a1426, #082d5a);
    display: flex; 
    flex-direction: column; 
    min-height: 100vh;
    margin: 0;
    animation: gradientShift 8s ease-in-out infinite;
}

@keyframes gradientShift {
    0% {
        background-image: linear-gradient(to right, #0a1426, #082d5a);
    }
    50% {
        background-image: linear-gradient(to right, #0f1c33, #0a3a6e);
    }
    100% {
        background-image: linear-gradient(to right, #0a1426, #082d5a);
    }
}

.navbar {
    background-color: #03346E;
    padding: 15px 20px;
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    color: white;
    animation: slideDown 0.8s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.navbar a {
    float: left; 
    display: block;
    color: rgb(255, 255, 255);
    text-align: center;
    padding: 14px 20px;
    text-decoration: none;
    font-size: 17px;
    transition: all 0.3s ease;
    position: relative;
}

.navbar a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: #4dc2f7;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar a:hover::after {
    width: 80%;
}

.navbar h1 {
    margin: 0; 
    animation: fadeIn 1s ease-out 0.2s both;
}

.navbar a:hover {
    background-color: rgba(221, 221, 221, 0.1);
    color: #4dc2f7;
    transform: translateY(-2px);
}

.navbar .brand {
    color: white;
    text-decoration: none;
    font-size: 24px;
    transition: all 0.3s ease;
}

.navbar .brand:hover {
    transform: scale(1.05);
}

.register-button {
    background-color: #007bff; 
    color: white;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 5px; 
    transition: all 0.3s ease; 
    animation: pulse 2s infinite;
}

.register-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

.main-content {
    flex-grow: 1; 
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.8s ease-out 0.4s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.login-container {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
    margin: 20px 0;
    animation: slideUp 0.8s ease-out 0.6s both;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-container h2 {
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 2rem;
    animation: fadeIn 0.8s ease-out 0.8s both;
}

.input-group {
    margin-bottom: 25px;
    text-align: left;
    animation: fadeIn 0.8s ease-out 1s both;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: bold;
    transition: all 0.3s ease;
}

.input-group input[type="text"],
.input-group input[type="password"],
.input-group input[type="email"], 
.input-group input[type="tel"],
.input-group textarea { 
    width: 90%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.8);
}

.input-group input[type="text"]:focus,
.input-group input[type="password"]:focus,
.input-group input[type="email"]:focus, 
.input-group input[type="tel"]:focus,   
.input-group textarea:focus {   
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    transform: translateY(-2px);
}

.input-group input:valid {
    border-color: #28a745;
}

.remember-me {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    justify-content: flex-start;
    animation: fadeIn 0.8s ease-out 1.2s both;
}

.remember-me input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
    transition: all 0.3s ease;
}

.remember-me input[type="checkbox"]:checked {
    accent-color: #007bff;
}

.remember-me label {
    color: #666;
    font-size: 15px;
    transition: color 0.3s ease;
}

.remember-me:hover label {
    color: #2c3e50;
}

button {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 16px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 17px;
    width: 100%;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.8s ease-out 1.4s both;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

button:hover::before {
    left: 100%;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
    background: linear-gradient(135deg, #0056b3, #004085);
}

button:active {
    transform: translateY(-1px);
}

.forgot-password {
    margin-top: 25px;
    font-size: 14px;
    animation: fadeIn 0.8s ease-out 1.6s both;
}

.forgot-password a {
    color: #007bff;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.forgot-password a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #007bff;
    transition: width 0.3s ease;
}

.forgot-password a:hover::after {
    width: 100%;
}

.forgot-password a:hover {
    color: #0056b3;
}

/* Floating animation untuk container */
.login-container {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Input field animation saat focus */
.input-group {
    position: relative;
}

.input-group input:focus + label {
    color: #007bff;
    transform: translateY(-5px);
    font-size: 0.8rem;
}

/* Success animation untuk form submission */
@keyframes success {
    0% {
        background-color: rgba(255, 255, 255, 0.95);
    }
    50% {
        background-color: rgba(40, 167, 69, 0.1);
    }
    100% {
        background-color: rgba(255, 255, 255, 0.95);
    }
}

.login-container.success {
    animation: success 2s ease;
}

/* Gaya Responsif untuk Ukuran Layar 425px */
@media (max-width: 425px) {
    body {
        padding: 10px;
        animation: none;
    }

    .main-content {
        width: 100%;
        margin-top: 20px;
        animation: fadeIn 0.8s ease-out;
    }

    .login-container {
        width: 90%;
        padding: 25px 20px;
        margin: 20px auto;
        animation: slideUp 0.8s ease-out;
    }

    h1.brand {
        font-size: 1.5em;
    }

    .login-container h2 {
        font-size: 1.8em;
        margin-bottom: 25px;
    }

    label {
        font-size: 0.9em;
    }

    .input-group {
        margin-bottom: 20px;
    }

    .input-group input {
        height: 45px;
        font-size: 1em;
        padding: 12px;
    }

    button[type="submit"] {
        padding: 14px;
        font-size: 1em;
        width: 100%;
    }

    .navbar {
        padding: 10px 15px;
        text-align: center;
        flex-direction: column;
        gap: 10px;
    }

    .navbar a {
        padding: 10px 15px;
        font-size: 16px;
    }

    /* Adjust animations for mobile */
    .login-container {
        animation: float 8s ease-in-out infinite;
    }
}

/* Additional responsive design */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
    }
    
    .navbar nav {
        width: 100%;
        order: 3;
        margin-top: 10px;
    }
    
    .navbar nav ul {
        justify-content: center;
    }
}

/* ===== PASSWORD FIELD FIX ===== */

/* ===== FINAL FIX PASSWORD ICON ===== */

.password-field {
    position: relative;
    width: 100%;
}

.password-field input {
    width: 100% !important; /* override width:90% */
    padding-right: 45px !important;
    box-sizing: border-box;
}

.eye-icon {
    position: absolute;
    right: 15px;
    top: 25%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 16px;
    color: #777;
    user-select: none;
}

.eye-icon:hover {
    color: #007bff;
}



/* Loading animation untuk elements bertahap */
.input-group:nth-child(1) { animation-delay: 1s; }
.input-group:nth-child(2) { animation-delay: 1.1s; }
.remember-me { animation-delay: 1.2s; }
button { animation-delay: 1.3s; }
.forgot-password { animation-delay: 1.4s; }
/* ===== PASSWORD VALIDATION ===== */

.password-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #dc3545; /* merah default */
}

.input-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.input-success {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.15);
}
.input-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.input-success {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

.password-hint {
    display: block;
    font-size: 13px;
    margin-top: 6px;
    color: #dc3545;
}

