/* Modal styles for case study download form */
.modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(18, 18, 18, 0.9);
    animation: fadeIn 0.3s ease-out;
    /* Flexbox for vertical centering */
    display: none;
    align-items: center;
    justify-content: center;
}

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

.modal-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    margin: auto;
    padding: 40px;
    border: 1px solid rgba(255, 182, 193, 0.3);
    border-radius: 12px;
    width: 90%;
    max-width: 800px; /* Increased from 600px */
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5),
                0 0 50px rgba(255, 182, 193, 0.1);
    animation: slideIn 0.3s ease-out;
    position: relative;
}

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

.close {
    color: #aaaaaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    position: absolute;
    right: 20px;
    top: 20px;
}

.close:hover,
.close:focus {
    color: #FFB6C1;
}

.modal-content h2 {
    color: #FFB6C1;
    font-family: 'Space Mono', monospace;
    font-size: 28px;
    margin-bottom: 15px;
    text-align: center;
}

.modal-content p {
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Space Grotesk', sans-serif;
    text-align: center;
    margin-bottom: 30px;
    font-size: 16px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Floating Labels */
.form-label {
    position: absolute;
    left: 0.75rem;
    top: -0.5rem;
    font-size: 0.75rem;
    font-family: 'Space Grotesk', sans-serif;
    color: #FFB6C1;
    font-weight: 400;
    transition: all 0.3s ease;
    pointer-events: none;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 0 0.5rem;
    z-index: 20;
    opacity: 0;
    transform: translateY(0);
}

/* Show label only when input has content */
.form-input:not(:placeholder-shown) ~ .form-label,
.form-label.floating {
    opacity: 1;
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'Space Grotesk', sans-serif;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  transition: all 0.3s ease;
}

textarea.form-input {
  resize: none;
}

.form-input:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
}

.form-input:focus {
  outline: none !important;
  border-color: #FFB6C1;
  box-shadow: none !important;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.submit-btn {
    width: 100%;
    padding: 14px 28px;
    background: #ffffff;
    color: #121212;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    text-transform: none;
    letter-spacing: 1px;
}

.submit-btn:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 182, 193, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Disabled button styles */
.btn:disabled {
    background-color: #666 !important;
    color: #999 !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    transform: none !important;
    box-shadow: none !important;
}

.btn:disabled:hover {
    background-color: #666 !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Form validation styles - only show after user interaction */
.form-group.touched input:invalid:not(:focus),
.form-group.touched textarea:invalid:not(:focus) {
    border-color: #ff4444;
}

.form-group.touched input:valid:not(:focus):not(:placeholder-shown),
.form-group.touched textarea:valid:not(:focus):not(:placeholder-shown) {
    border-color: #44ff44;
}

/* Error message styles */
.error-message {
    display: block;
    color: #ff4444;
    font-size: 12px;
    margin-top: 5px;
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.4;
    min-height: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-message.show {
    opacity: 1;
}

.form-group.error input,
.form-group.error textarea {
    border-color: #ff4444;
    background-color: rgba(255, 68, 68, 0.05);
}

.form-group.error input:focus,
.form-group.error textarea:focus {
    border-color: #ff4444;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 30px 20px;
        margin: auto;
        max-width: none;
    }

    .modal-content h2 {
        font-size: 24px;
    }

    .form-group input,
    .form-group textarea {
        font-size: 16px;
        padding: 10px 14px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-row .form-group {
        margin-bottom: 20px;
    }

    .submit-btn {
        font-size: 15px;
        padding: 12px 24px;
    }
}

/* Accessibility improvements */
.modal:focus-visible,
.form-group input:focus-visible,
.form-group textarea:focus-visible,
.submit-btn:focus-visible {
    outline: 2px solid #FFB6C1;
    outline-offset: 2px;
}

/* Loading state for submit button */
.submit-btn.loading {
    position: relative;
    color: transparent;
}

.submit-btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #121212;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}