/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* Modal Container */
.modal-container {
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    background: #111;
    /* Fallback */
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.7);
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-sub, #A0A0A0);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
    z-index: 10;
}

.modal-close:hover {
    color: var(--text-main, #FFF);
}

/* Form Styles (Inherited & Adapted) */
.modal-form-header {
    text-align: center;
    margin-bottom: 32px;
}

.modal-form-header h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff 30%, #A0A0A0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #fff;
    /* Fallback */
}

.modal-form-header p {
    color: var(--text-sub, #A0A0A0);
    font-size: 15px;
    line-height: 1.5;
}

.modal-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.modal-form-group {
    position: relative;
}

.modal-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub, #A0A0A0);
    margin-bottom: 8px;
    margin-left: 4px;
}

.modal-form-control {
    width: 100%;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #FFF;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    height: 56px;
    /* Fixed height */
    box-sizing: border-box;
}

.modal-form-control:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: #00E065;
    box-shadow: 0 0 0 4px rgba(0, 224, 101, 0.1);
}

textarea.modal-form-control {
    resize: none;
    min-height: 120px;
    height: auto;
    line-height: 1.6;
}

.modal-checkbox-wrapper {
    margin: 24px 0 32px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.modal-custom-checkbox {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #A0A0A0;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    position: relative;
    margin-top: 2px;
    flex-shrink: 0;
}

.modal-custom-checkbox:checked {
    background: #00E065;
    border-color: #00E065;
}

.modal-custom-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.modal-checkbox-label {
    font-size: 14px;
    color: #A0A0A0;
    line-height: 1.5;
    cursor: pointer;
}

.modal-btn-submit {
    width: 100%;
    padding: 18px;
    background: #FFF;
    border: none;
    border-radius: 100px;
    color: #000;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s;
}

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

.modal-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.modal-message-box {
    margin-top: 20px;
    padding: 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    display: none;
}

.modal-message-box.success {
    display: block;
    background: rgba(0, 224, 101, 0.1);
    color: #00E065;
    border: 1px solid rgba(0, 224, 101, 0.2);
}

.modal-message-box.error {
    display: block;
    background: rgba(255, 46, 147, 0.1);
    color: #FF2E93;
    border: 1px solid rgba(255, 46, 147, 0.2);
}

@media (max-width: 768px) {
    .modal-container {
        padding: 30px 20px;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}