body, html{
    overflow-x: hidden;
}

/* Alert styles */
.alert {
    padding: 15px 20px;
    margin-bottom: 30px;
    border-radius: 5px;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Character counter */
.char-counter {
    text-align: right;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.main-body{
    display: flex; 
    justify-content: center;
    align-items: center;
    color: #242323b7;
    padding: 0 20px;
}

h3{ 
    font-weight: 500;
    color: #242323b7;
    font-size: 20px;
    margin-bottom: 20px;
    letter-spacing: 3px;
    text-align: center;
}

.contact {
    width: 100%;
    max-width: 500px;
}

.contact form{
    width: 100%;
    text-align: center;
}

form .input-box {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 10px;
}

.field .item{
    width: 100%;
    padding: 18px;
    background: transparent;
    border: 2px solid #242323b7;
    outline: none; 
    border-radius: 6px;
    font-size: 16px;
    margin: 12px 0;
    color: #5a5a5a;
    font-weight: 150;
    box-sizing: border-box;
}

.field.error .item{
    border-color: red;
}

.input-box .input-field{
    width: 48.5%;
    flex: 1;
}

form .textarea-field .item{
    resize: none;
    width: 100%;
    box-sizing: border-box;
}

form button{
    border: 2px solid #242323b7;
    border-radius: 6px;
    padding: 12px 24px;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

form button:hover {
    background-color: #242323b7;
    color: white;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 400px;
    width: 90%;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-icon {
    margin-bottom: 20px;
}

.modal-content h2 {
    color: #333;
    font-size: 28px;
    margin: 20px 0 10px 0;
    font-weight: 600;
}

.modal-content p {
    color: #666;
    font-size: 16px;
    margin-bottom: 30px;
    line-height: 1.5;
}

.ok-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.ok-btn:hover {
    transform: translateY(-2px);
}

.ok-btn:active {
    transform: translateY(0);
}
    margin-top: 20px;
    font-weight: 500;
    font-size: 14px;
    width: auto;
    min-width: 150px;
    color: #5a5a5a;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover{
    background-color: #F32B36;
    border: 2px solid #F32B36;
    color: #fff;
    transition: 0.3s;
}

.field .error-txt{
    display: none;
    font-size: 10px;
    color: red;
    text-align: left;
    margin: -5px 0 10px; 
}

.field.error .error-txt {
    display: block;
}

form .textarea-field .error-txt{
    margin-top: -10px;
}

/* Mobile-first responsive design */
@media only screen and (max-width: 768px) {
    .main-body{
        padding: 20px;
        margin-top: 20px;
    }
    
    .contact {
        max-width: 100%;
    }
    
    .contact form{
        width: 100%;
    }
    
    h3{
        font-size: 18px;
        letter-spacing: 2px;
        margin-bottom: 15px;
    }
    
    form .input-box {
        flex-direction: column;
        gap: 0;
    }
    
    .input-box .input-field{
        width: 100%;
        margin-bottom: 10px;
    }
    
    .field .item{
        padding: 15px;
        font-size: 16px;
        margin: 8px 0;
        min-height: 44px; /* Better touch target */
    }
    
    form button{
        width: 100%;
        max-width: 200px;
        padding: 15px 20px;
        font-size: 16px;
        margin-top: 15px;
        min-height: 44px; /* Better touch target */
    }
    
    /* Improve textarea on mobile */
    form .textarea-field .item {
        min-height: 120px;
        line-height: 1.4;
    }
}

@media only screen and (max-width: 480px) {
    .main-body{
        padding: 15px;
        margin-top: 15px;
    }
    
    h3{
        font-size: 16px;
        letter-spacing: 1px;
        margin-bottom: 12px;
    }
    
    .field .item{
        padding: 12px;
        font-size: 14px;
        margin: 6px 0;
        min-height: 44px;
    }
    
    form button{
        padding: 12px 16px;
        font-size: 14px;
        margin-top: 12px;
        min-height: 44px;
    }
    
    /* Ensure proper spacing on very small screens */
    .contact {
        padding: 0 5px;
    }
    
    form .input-box {
        margin-bottom: 5px;
    }
    
    .input-box .input-field {
        margin-bottom: 8px;
    }
}

/* Additional mobile improvements */
@media only screen and (max-width: 600px) {
    .main-body {
        padding: 15px 10px;
    }
    
    .contact form {
        padding: 0 5px;
    }
    
    /* Ensure form elements don't overflow on small screens */
    .field .item {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Better button positioning on mobile */
    form button {
        margin-left: auto;
        margin-right: auto;
        display: block;
    }
}

@media only screen and (max-width: 952px) {
    .main-body{
        justify-content: center;
        align-items: center;
        margin-left: 0;
        margin-right: 0;
    }
    
    .contact form{
        width: 100%;
        max-width: 400px;
    }
    
    h3{
        width: 100%;
        text-align: center;
    }
}