@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap");

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: url('img.jpg') no-repeat;
    background-size: cover;
    background-position: center;
}

/* Wrapper Animation */
.wrapper {
    width: 420px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, .2);
    backdrop-filter: blur(20px);
    box-shadow: 0 0 10px rgba(0, 0, 0, .2);
    color: #fff;
    border-radius: 10px;
    padding: 30px 40px;
    opacity: 0; /* Start hidden */
    transform: translateY(-50px); /* Slide-in effect */
    transition: opacity 1.15s ease, transform 1.15s ease; /* Smooth transition */
}

@media (max-width: 600px) {
    .wrapper {
        width: 90%; /* Adjust width to 90% of the screen width */
        padding: 20px 20px; /* Reduce padding */
    }
}

.wrapper.show {
    opacity: 1;
    transform: translateY(0); /* Slide into place */
}

.wrapper h1 {
    font-size: 36px;
    text-align: center;
}

/* Input Box Animation */
.wrapper .input-box {
    position: relative;
    width: 100%;
    height: 50px;
    margin: 30px 0;
}

.input-box input {
    width: 100%;
    height: 50px;
    background: transparent;
    border: none;
    outline: none;
    border: 2px solid rgba(255, 255, 255, .2);
    border-radius: 40px;
    font-size: 16px;
    color: #fff;
    padding: 20px 45px 20px 20px;
    transition: border-color 0.3s ease; /* Smooth border transition */
}

.input-box input::placeholder {
    color: #fff;
}

.input-box input:focus {
    border-color: #dfdfdf; /* Change border color on focus */
}

/* Button Hover Animation */
.wrapper .btn {
    width: 100%;
    height: 45px;
    background: #fff;
    border: none;
    outline: none;
    border-radius: 40px;
    box-shadow: 0 0 10px rgba(0, 0, 0, .1);
    cursor: pointer;
    font-size: 16px;
    color: #333;
    font-weight: 600;
    transition: transform 0.3s ease, background-color 0.3s ease; /* Button hover transition */
}

.wrapper .btn:hover {
    transform: scale(1.05); /* Slightly enlarges the button on hover */
    background-color: #f0f0f0; /* Lighten button color */
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 93, 155, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

.input-box i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.shake {
    animation: shake 0.5s ease;
}

.input-box {
    position: relative;
    width: 100%;
    height: 50px;
    margin: 30px 0;
}

.input-box label {
    position: absolute;
    top: 50%;
    left: 20px;
    color: #fff;
    transform: translateY(-50%);
    transition: 0.3s ease;
    pointer-events: none; /* Prevent interaction with the label */
    font-size: 16px;
    opacity: 0; /* Hide the label initially */
}

.input-box input:focus + label,
.input-box input:not(:placeholder-shown) + label {
    top: -10px;
    left: 20px;
    font-size: 12px;
    color: #fff; /* Color change when label is floating */
    background-color: rgba(0, 0, 0, 0.5); /* Optional background for better readability */
    padding: 0 5px;
    border-radius: 5px;
    opacity: 1; /* Show the label */
}

.input-box input:focus::placeholder {
    color: transparent;
}

#error-message {
    color: red;
    display: none;
    text-align: center; /* Center text horizontally */
    width: 100%; /* Make the error message span the width of the form */
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4caf50;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

/* Keyframes for the spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#greeting {
    text-align: center;
    font-size: 24px;
    color: #fff; /* A soft, romantic color */
    margin-bottom: 20px;
}
