body{
    font-family: "Fustat", sans-serif;
    aspect-ratio: 960/540;
    width: 100%;
    background-size: cover;
    background: linear-gradient(135deg, #f5f7fa 0%, #e3e9f0 100%);
    height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background Pattern - Dotted Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%233333CB' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: -1;
    animation: float-pattern 20s linear infinite;
}

@keyframes float-pattern {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(-60px) translateY(-60px); }
}

h2 {
    font-family: "Unbounded", sans-serif;
    font-optical-sizing: auto;
    font-style: bold;
    font-size: 30px;
    color: black;
    margin-bottom: 20px;
    margin-top: 10px;
  }

.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(176, 176, 176, 0.9);
    padding: 20px;
    margin: 50px auto;
    width: 45%;
    text-align: center;
    height: 100%;
}

form {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: top;
}

form input {
    width: 55%; /* Adjust width as needed */
    padding: 10px;
    margin: 8px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: "Fustat", sans-serif;
    letter-spacing: 0.5px;
    word-spacing: 1px;
}

.submit {
    width: 50%; 
    background: linear-gradient(-45deg, #3333CB 40%, #DBFFF9 50%, #3333CB 60%);
    background-size: 300%;
    background-position-x: 100%;
    animation-duration: 4s;
    animation-name: shimmer;
    animation-iteration-count: infinite;
    border: none;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    color: white;
    font-family: "Fustat", sans-serif;
    font-size: 15px;
}


.back{
    width: 50%; 
    background: white;
    background-size: 300%;
    background-position-x: 100%;
    border: solid;
    border-color: #3333CB;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    color: #3333CB;
    font-family: "Fustat", sans-serif;
    font-size: 15px;
    text-decoration: none;
}


@keyframes shimmer {
    to {
       background-position-x: -1%
    }
 }

.submit:hover {
    background-color: #0056b3;
    box-shadow: 0px 10px 5px 2px rgba(0, 0, 0, 0.2);
}


.submit{
    margin-top: 15px;
    margin-bottom: 0px;
}


.back:hover {
    background-color: #F2F2F2;
}

.account {
    font-size: 15px;
    font-family: "Fustat", sans-serif;
    background: white;
    padding: 10px; /* Match input fields */
    width: 58.5%; /* Adjust width as needed */
    padding: 10px;
    margin: 8px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
}


p{
    margin-top: 5px;
}

.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .card {
        width: 55%;
        padding: 18px;
    }
    
    form input, .account {
        width: 60%;
    }
    
    .submit, .back {
        width: 55%;
    }
}

@media (max-width: 992px) {
    body {
        padding: 15px;
    }
    
    .card {
        width: 65%;
        padding: 20px;
        margin: 30px auto;
        height: auto;
        min-height: 80vh;
    }
    
    h2 {
        font-size: 26px;
        margin-bottom: 15px;
    }
    
    form input, .account {
        width: 70%;
        padding: 12px;
        margin: 10px 0;
        font-size: 15px;
    }
    
    .submit, .back {
        width: 60%;
        padding: 12px;
        font-size: 16px;
        margin-top: 15px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
        height: auto;
        min-height: 100vh;
    }
    
    .card {
        width: 85%;
        max-width: 350px;
        padding: 25px 20px;
        margin: 20px auto;
        height: auto;
        min-height: auto;
    }
    
    h2 {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    form {
        width: 100%;
    }
    
    form input, .account {
        width: 70%;
        padding: 12px 16px;
        margin: 10px 0;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 8px;
        border: 1px solid #ddd;
    }
    
    .submit, .back {
        width: 70%;
        padding: 14px 20px;
        font-size: 16px;
        margin-top: 20px;
        border-radius: 12px;
    }
    
    .error-message {
        font-size: 15px;
        margin-top: 15px;
        padding: 10px;
    }
}

@media (max-width: 576px) {
    body {
        padding: 8px;
    }
    
    .card {
        width: 95%;
        padding: 20px 15px;
        margin: 15px auto;
    }
    
    h2 {
        font-size: 22px;
        margin-bottom: 15px;
    }
    
    form input, .account {
        width: 90%;
        padding: 10px 14px;
        margin: 8px 0;
        font-size: 15px;
        border-radius: 6px;
    }
    
    .submit, .back {
        width: 85%;
        padding: 12px 18px;
        font-size: 15px;
        margin-top: 15px;
    }
    
    .error-message {
        font-size: 14px;
        margin-top: 12px;
    }
}

@media (max-width: 480px) {
    .card {
        width: 100%;
        padding: 18px 12px;
        margin: 10px auto;
    }
    
    h2 {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    form input, .account {
        width: 95%;
        padding: 8px 12px;
        margin: 6px 0;
        font-size: 14px;
    }
    
    .submit, .back {
        width: 90%;
        padding: 10px 16px;
        font-size: 14px;
        margin-top: 12px;
    }
    
    .error-message {
        font-size: 13px;
        margin-top: 10px;
    }
}

@media (max-width: 320px) {
    .card {
        padding: 15px 10px;
    }
    
    h2 {
        font-size: 18px;
    }
    
    form input, .account {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .submit, .back {
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* Touch-friendly improvements for mobile */
@media (hover: none) and (pointer: coarse) {
    .submit:hover {
        background: linear-gradient(-45deg, #3333CB 40%, #DBFFF9 50%, #3333CB 60%);
    }
    
    .submit:active {
        background-color: #0000ff;
        transform: scale(0.98);
    }
    
    .back:hover {
        background-color: white;
    }
    
    .back:active {
        background-color: #F2F2F2;
        transform: scale(0.98);
    }
}

/* Improved form validation styling on mobile */
@media (max-width: 768px) {
    form input:focus,
    .account:focus {
        border-color: #3333CB;
        outline: none;
        box-shadow: 0 0 0 2px rgba(51, 51, 203, 0.1);
    }
}

/* Loading state improvements for mobile */
@media (max-width: 768px) {
    .submit:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        background-color: #a5a5a5;
    }
}

/* Accessibility improvements for mobile */
@media (max-width: 768px) {
    form input:focus,
    .account:focus,
    .submit:focus,
    .back:focus {
        outline: 2px solid #3333CB;
        outline-offset: 2px;
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    body {
        padding: 5px;
    }
    
    .card {
        margin: 10px auto;
        padding: 20px 15px;
    }
    
    h2 {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    form input, .account {
        margin: 6px 0;
        padding: 8px 12px;
    }
    
    .submit, .back {
        margin-top: 10px;
        padding: 10px 16px;
    }
}


