/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    min-height: 100vh;
    padding: 20px;
}

/* Container and layout */
.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px 0;
}

.form-wrapper {
    background: #ffffff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 115, 195, 0.1);
    border: 1px solid #e9ecef;
    position: relative;
}

.form-wrapper h2 {
    color: #0073c3;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
}

.form-wrapper p {
    color: #6c757d;
    text-align: center;
    margin-bottom: 32px;
    font-size: 16px;
}

/* Form groups */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group label {
    display: block;
    font-weight: 600;
    /* color: #495057; */
    color: white;
    margin-bottom: 8px;
    font-size: 14px;
    background-color: #0074cc;
}
.label {
  background-color: #0074cc;
  color: white;
  font-weight: bold; 
  padding: 4px 10px; 
  border-radius: 4px; 
  display: inline-block; 
  font-family: Arial, sans-serif; 
  font-size: 14px; 
  line-height: 1; 
}

/* Input fields */
input[type="text"],
input[type="email"] {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background-color: #ffffff;
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus {
    border-color: #0073c3;
    box-shadow: 0 0 0 3px rgba(0, 115, 195, 0.1);
}

/* Input validation states */
.input-typing {
    border-color: #fd7e14 !important;
    box-shadow: 0 0 0 3px rgba(253, 126, 20, 0.1) !important;
}

.input-valid {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1) !important;
}

.input-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

/* Field hints */
.field-hint {
    font-size: 12px;
    color: #6c757d;
    margin-top: 6px;
    transition: color 0.3s ease;
}

.input-valid + .field-hint {
    color: #28a745;
}

.input-invalid + .field-hint {
    color: #dc3545;
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    padding: 14px 28px;
    font-size: 16px;
    line-height: 1.5;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    min-width: 120px;
}

.btn-primary {
    background-color: #0073c3;
    color: #ffffff;
    border: 2px solid #0073c3;
}

.btn-primary:hover:not(:disabled) {
    background-color: #005ba1;
    border-color: #005ba1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 115, 195, 0.3);
}

.btn-secondary {
    background-color: #6c757d;
    color: #ffffff;
    border: 2px solid #6c757d;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #5a6268;
    border-color: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Submit button states */
.btn-disabled {
    background-color: #e9ecef !important;
    color: #6c757d !important;
    border-color: #e9ecef !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.btn-enabled {
    background-color: #0073c3;
    color: #ffffff;
    border-color: #0073c3;
}

#submit-btn {
    width: 100%;
    margin-top: 16px;
    font-size: 18px;
    padding: 16px;
}

/* Success overlay */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.success-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    position: relative;
    z-index: 1001;
}

.success-content h3 {
    color: #28a745;
    font-size: 24px;
    margin-bottom: 16px;
}

.success-content p {
    color: #495057;
    margin-bottom: 32px;
    font-size: 16px;
}

.success-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Error message */
.error-message {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.error-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    position: relative;
    z-index: 1001;
}

.error-content h3 {
    color: #dc3545;
    font-size: 24px;
    margin-bottom: 16px;
}

.error-content p {
    color: #495057;
    margin-bottom: 32px;
    font-size: 16px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Loading state */
.btn:disabled {
    position: relative;
    overflow: hidden;
}

.btn:disabled:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .form-wrapper {
        padding: 24px;
        margin: 10px 0;
    }
    
    .form-wrapper h2 {
        font-size: 24px;
    }
    
    .success-content,
    .error-content {
        padding: 24px;
        margin: 20px;
    }
    
    .success-buttons {
        flex-direction: column;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    #submit-btn {
        font-size: 16px;
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px 0;
    }
    
    .form-wrapper {
        padding: 20px;
    }
    
    input[type="text"],
    input[type="email"] {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .success-content,
    .error-content {
        padding: 20px;
        margin: 10px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    input[type="text"],
    input[type="email"] {
        border-width: 3px;
    }
    
    .btn {
        border-width: 3px;
    }
}

/* Focus visible for keyboard navigation */
.btn:focus-visible,
input:focus-visible {
    outline: 3px solid #0073c3;
    outline-offset: 2px;
}