/* Hide scrollbars globally */
::-webkit-scrollbar {
    display: none;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Modal Overlay Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

.modal-overlay.show {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-container {
    position: relative;
    width: 95%;
    max-width: 568px;
    height: 80vh;
    overflow-y: auto;
    z-index: 10000;
    animation: slideInUp 0.4s ease-out;
    padding: 10px;
    margin-bottom: -1px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.modal-container::-webkit-scrollbar {
    display: none;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: all 0.3s ease;
    color: #4a5568;
}

.modal-close:hover {
    background: white;
    color: #2d3748;
    transform: scale(1.1);
}

/* Original body styles for standalone form */
body.modal-open {
    overflow: hidden;
}

body:not(.modal-open) .form-container {
    width: 100%;
    max-width: 600px;
    margin: 40px auto;
    animation: fadeInUp 0.6s ease-out;
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body:not(.modal-open) .form-container::-webkit-scrollbar {
    display: none;
}

.form-wrapper {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px 18px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    height: 100%;
    overflow: hidden;
}

.form-header {
    text-align: center;
    margin-bottom: 15px;
}

.logo-container {
    margin-bottom: 15px;
}

.form-logo {
    max-width: 80px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.form-header h1 {
    color: #2d3748;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 5px;
    background: #656BED;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.form-header p {
    color: #718096;
    font-size: 0.8rem;
    line-height: 1.3;
}

.modern-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: #4a5568;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #656BED;
    box-shadow: 0 0 0 3px rgba(101, 107, 237, 0.1);
    transform: translateY(-2px);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #cbd5e0;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #4a5568;
    font-size: 0.875rem;
    position: relative;
    padding-left: 28px;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 20px;
    width: 20px;
    background-color: #e2e8f0;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.checkbox-label:hover input ~ .checkmark {
    background-color: #cbd5e0;
}

.checkbox-label input:checked ~ .checkmark {
    background-color: #656BED;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input:checked ~ .checkmark:after {
    display: block;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-primary,
.btn-secondary {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    flex: 1;
}

.btn-primary {
    background: #656BED;
    color: white;
    box-shadow: 0 4px 15px rgba(101, 107, 237, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(101, 107, 237, 0.4);
}

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

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: translateY(-2px);
}

.success-message {
    display: none;
    text-align: center;
    padding: 20px;
    animation: fadeInUp 0.6s ease-out;
}

.success-message.show {
    display: block;
}

.success-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #48bb78, #38a169);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 18px;
    color: white;
    font-weight: bold;
}

.success-message h3 {
    color: #2d3748;
    font-size: 1rem;
    margin-bottom: 6px;
}

.success-message p {
    color: #718096;
    font-size: 0.8rem;
}

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

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

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

@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        max-width: none;
        margin: 10px;
        height: 85vh;
    }
    
    .form-wrapper {
        padding: 18px 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-header h1 {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .modal-container {
        width: 98%;
        margin: 5px;
        height: 90vh;
    }
    
    .form-wrapper {
        padding: 15px 12px;
    }
    
    .form-header h1 {
        font-size: 1rem;
    }
}
